From 2ba6e04dacfb9140d23d79cba79adb6c8440660c Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Tue, 26 May 2026 22:19:07 +0900
Subject: Remove non-"unicode tables" related code.

Unicode is the de facto standard for text handling. In 2026 it does not
make sense to keep around non-"unicode tables" related code.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 doc/features.doc              |  4 --
 qmake/Makefile.unix           |  2 +-
 src/tools/tqchar.cpp          | 18 ---------
 src/tools/tqconfig-large.h    |  1 -
 src/tools/tqconfig-medium.h   |  1 -
 src/tools/tqconfig-minimal.h  |  1 -
 src/tools/tqconfig-small.h    |  1 -
 src/tools/tqfeatures.h        |  3 --
 src/tools/tqfeatures.txt      |  6 ---
 src/tools/tqstring.cpp        |  7 ----
 src/tools/tqunicodetables.cpp | 94 -------------------------------------------
 src/tools/tqunicodetables_p.h | 52 ------------------------
 12 files changed, 1 insertion(+), 189 deletions(-)

diff --git a/doc/features.doc b/doc/features.doc
index 9dd976245..61ef88646 100644
--- a/doc/features.doc
+++ b/doc/features.doc
@@ -92,10 +92,6 @@ The available options are:
 \row \i TQT_NO_I18N
      \i Conversions between Unicode and 8-bit encodings.
      \i &nbsp;
-\row \i TQT_NO_UNICODETABLES
-     \i Large tables defining such things as upper and lowercase conversions
-	for all Unicode characters.
-     \i &nbsp;
 
 \header \i31 MIME
 \row \i TQT_NO_MIME
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index c1081994d..79f3b35c4 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -36,7 +36,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp qtmd5.cpp generators/makef
 CXXFLAGS= @QMAKE_CXXFLAGS@ \
 	-I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \
 	-I@BUILD_PATH@/include/qmake -I@BUILD_PATH@/include -I@SOURCE_PATH@/include \
-	-DTQT_NO_TEXTCODEC -DTQT_NO_UNICODETABLES -DTQT_NO_COMPONENT -DTQT_NO_STL \
+	-DTQT_NO_TEXTCODEC -DTQT_NO_COMPONENT -DTQT_NO_STL \
 	-DTQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP
 LFLAGS=@QMAKE_LFLAGS@
 
diff --git a/src/tools/tqchar.cpp b/src/tools/tqchar.cpp
index afe4bc9a6..9ff024d0d 100644
--- a/src/tools/tqchar.cpp
+++ b/src/tools/tqchar.cpp
@@ -641,18 +641,10 @@ bool TQChar::isSymbol() const
 */
 int TQChar::digitValue() const
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::decimal_info[row()];
     if( !pos )
 	return -1;
     return TQUnicodeTables::decimal_info[(pos<<8) + cell()];
-#else
-    // ##### just latin1
-    if ( ucs < '0' || ucs > '9' )
-	return -1;
-    else
-	return ucs - '0';
-#endif
 }
 
 /*!
@@ -707,10 +699,8 @@ TQChar TQChar::mirroredChar() const
     return ::mirroredChar( *this );
 }
 
-#ifndef TQT_NO_UNICODETABLES
 // ### REMOVE ME 4.0
 static TQString shared_decomp;
-#endif
 /*!
     \nonreentrant
 
@@ -719,7 +709,6 @@ static TQString shared_decomp;
 */
 const TQString &TQChar::decomposition() const
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::decomposition_info[row()];
     if(!pos) return TQString::null;
 
@@ -735,9 +724,6 @@ const TQString &TQChar::decomposition() const
     // prevents this function from being reentrant.
     shared_decomp = s;
     return shared_decomp;
-#else
-    return TQString::null;
-#endif
 }
 
 /*!
@@ -746,7 +732,6 @@ const TQString &TQChar::decomposition() const
 */
 TQChar::Decomposition TQChar::decompositionTag() const
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::decomposition_info[row()];
     if(!pos) return TQChar::Single;
 
@@ -754,9 +739,6 @@ TQChar::Decomposition TQChar::decompositionTag() const
     if(!pos) return TQChar::Single;
 
     return (TQChar::Decomposition) TQUnicodeTables::decomposition_map[pos];
-#else
-    return Single; // ########### FIX eg. just latin1
-#endif
 }
 
 /*!
diff --git a/src/tools/tqconfig-large.h b/src/tools/tqconfig-large.h
index d2f8321ce..8131f740f 100644
--- a/src/tools/tqconfig-large.h
+++ b/src/tools/tqconfig-large.h
@@ -3,7 +3,6 @@
 #ifndef TQT_NO_CODECS
 #define TQT_NO_CODECS
 #endif
-#define TQT_NO_UNICODETABLES
 #define TQT_NO_IMAGEIO_BMP
 #define TQT_NO_IMAGEIO_PPM
 #define TQT_NO_ASYNC_IO
diff --git a/src/tools/tqconfig-medium.h b/src/tools/tqconfig-medium.h
index 93bc436e6..b6beb0d44 100644
--- a/src/tools/tqconfig-medium.h
+++ b/src/tools/tqconfig-medium.h
@@ -3,7 +3,6 @@
 #ifndef TQT_NO_TEXTCODEC /* moc? */
 #define TQT_NO_TEXTCODEC
 #endif
-#define TQT_NO_UNICODETABLES
 #define TQT_NO_IMAGEIO_BMP
 #define TQT_NO_IMAGEIO_PPM
 /* #define TQT_NO_IMAGEIO_PNG */
diff --git a/src/tools/tqconfig-minimal.h b/src/tools/tqconfig-minimal.h
index 2d98d14ea..2c2232560 100644
--- a/src/tools/tqconfig-minimal.h
+++ b/src/tools/tqconfig-minimal.h
@@ -10,7 +10,6 @@
 #ifndef TQT_NO_TEXTCODEC /* moc? */
 #define TQT_NO_TEXTCODEC
 #endif
-#define TQT_NO_UNICODETABLES
 #define TQT_NO_IMAGEIO_BMP
 #define TQT_NO_IMAGEIO_PPM
 #define TQT_NO_IMAGEIO_XBM
diff --git a/src/tools/tqconfig-small.h b/src/tools/tqconfig-small.h
index d7d08b795..cbab85588 100644
--- a/src/tools/tqconfig-small.h
+++ b/src/tools/tqconfig-small.h
@@ -6,7 +6,6 @@
 #ifndef TQT_NO_TEXTCODEC /* moc? */
 #define TQT_NO_TEXTCODEC
 #endif
-#define TQT_NO_UNICODETABLES
 #define TQT_NO_IMAGEIO_BMP
 #define TQT_NO_IMAGEIO_PPM
 #define TQT_NO_IMAGEIO_XBM
diff --git a/src/tools/tqfeatures.h b/src/tools/tqfeatures.h
index 88f7247ad..b49040882 100644
--- a/src/tools/tqfeatures.h
+++ b/src/tools/tqfeatures.h
@@ -80,9 +80,6 @@
 // TQTextStream
 //#define TQT_NO_TEXTSTREAM
 
-// Unicode property tables
-//#define TQT_NO_UNICODETABLES
-
 // Input validators
 //#define TQT_NO_VALIDATOR
 
diff --git a/src/tools/tqfeatures.txt b/src/tools/tqfeatures.txt
index fa42349b2..292671bff 100644
--- a/src/tools/tqfeatures.txt
+++ b/src/tools/tqfeatures.txt
@@ -347,12 +347,6 @@ Requires: CODECS COMPLEXTEXT
 Name: Hebrew Codec
 SeeAlso: ???
 
-Feature: UNICODETABLES
-Section: Internationalization
-Requires:
-Name: Unicode property tables
-SeeAlso: ???
-
 Feature: MIME
 Section: File I/O
 Requires: DIR IMAGEIO TEXTCODEC
diff --git a/src/tools/tqstring.cpp b/src/tools/tqstring.cpp
index 6a83ff2af..eb4b1fc07 100644
--- a/src/tools/tqstring.cpp
+++ b/src/tools/tqstring.cpp
@@ -167,8 +167,6 @@ static char qToLower(char c)
     	return c;
 }
 
-#ifndef TQT_NO_UNICODETABLES
-
 // small class used internally in TQString::Compose()
 class TQLigature
 {
@@ -240,7 +238,6 @@ int TQLigature::match(TQString & str, unsigned int index)
     return 0;
 }
 
-
 // this function is just used in TQString::compose()
 static inline bool format(TQChar::Decomposition tag, TQString & str,
 			  int index, int len)
@@ -272,7 +269,6 @@ static inline bool format(TQChar::Decomposition tag, TQString & str,
 	return (!right && !left);
     }
 } // format()
-#endif
 
 TQStringData::TQStringData() : TQShared(),
 	unicode(0),
@@ -357,7 +353,6 @@ void TQStringData::setDirty() {
 */
 void TQString::compose()
 {
-#ifndef TQT_NO_UNICODETABLES
     unsigned int index=0, len;
     unsigned int cindex = 0;
 
@@ -399,10 +394,8 @@ void TQString::compose()
 	index++;
     }
     *this = composed;
-#endif
 }
 
-
 // These macros are used for efficient allocation of TQChar strings.
 // IMPORTANT! If you change these, make sure you also change the
 // "delete unicode" statement in ~TQStringData() in tqstring.h correspondingly!
diff --git a/src/tools/tqunicodetables.cpp b/src/tools/tqunicodetables.cpp
index 9a34baf1f..9e91fe640 100644
--- a/src/tools/tqunicodetables.cpp
+++ b/src/tools/tqunicodetables.cpp
@@ -251,7 +251,6 @@ for $row ( 0..255 ) {
 }
 
 print "// START OF GENERATED DATA\n\n";
-print "#ifndef TQT_NO_UNICODETABLES\n\n";
 
 # Print pages...
 #
@@ -584,9 +583,6 @@ print $row_txt;
 print "};\n";
 print "// $size bytes\n\n";
 
-
-
-print "#endif\n\n";
 print "// END OF GENERATED DATA\n\n";
 
 
@@ -596,8 +592,6 @@ __END__
 
 // START OF GENERATED DATA
 
-#ifndef TQT_NO_UNICODETABLES
-
 const TQ_UINT8 TQUnicodeTables::unicode_info[] = {
     1, 2, 3, 4, 5, 6, 7, 8,
     9, 10, 11, 12, 13, 14, 15, 16,
@@ -11417,47 +11411,6 @@ const TQ_INT8 TQUnicodeTables::decimal_info[] = {
 };
 // 40698 bytes
 
-#endif
-
-#ifdef TQT_NO_UNICODETABLES
-
-const TQ_UINT8 TQUnicodeTables::latin1_line_break_info[] = {
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 15, 23, 19, 21, 22, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    26, 5, 2, 11, 8, 9, 11, 2,
-    0, 1, 11, 8, 7, 14, 7, 6,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 7, 7, 11, 11, 11, 5,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 0, 8, 1, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 0, 15, 1, 11, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    19, 19, 19, 19, 19, 19, 19, 19,
-    3, 11, 9, 8, 8, 8, 11, 11,
-    11, 11, 11, 2, 11, 15, 11, 11,
-    9, 8, 11, 11, 16, 11, 11, 11,
-    11, 11, 11, 2, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-    11, 11, 11, 11, 11, 11, 11, 11,
-};
-
-#else
-
 const TQ_UINT8 TQUnicodeTables::line_break_info[] = {
     1, 2, 3, 4, 5, 6, 7, 8,
     2, 9, 10, 11, 12, 13, 14, 15,
@@ -12947,13 +12900,8 @@ const TQ_UINT8 TQUnicodeTables::line_break_info[] = {
 };
 // 52474 bytes
 
-#endif
-
 // END OF GENERATED DATA
 
-
-
-#ifndef TQT_NO_UNICODETABLES
 const TQ_UINT16 TQUnicodeTables::symmetricPairs[] = {
     0x0028, 0x0029, 0x003C, 0x003E, 0x005B, 0x005D, 0x007B, 0x007D,
     0x00AB, 0x00BB, 0x2039, 0x203A, 0x2045, 0x2046, 0x207D, 0x207E,
@@ -13001,48 +12949,6 @@ const TQ_UINT16 TQUnicodeTables::symmetricPairs[] = {
 const int TQUnicodeTables::symmetricPairsSize =
    sizeof(symmetricPairs)/sizeof(symmetricPairs[0]);
 
-#else
-
-/*
-  only include info for the first unicode range (latin1) when building
-  without unicode tables.
-*/
-const TQ_UINT8 TQUnicodeTables::unicode_info[] = {
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    7, 26, 26, 26, 28, 26, 26, 26,
-    22, 23, 26, 27, 26, 21, 26, 26,
-    4, 4, 4, 4, 4, 4, 4, 4,
-    4, 4, 26, 26, 27, 27, 27, 26,
-    26, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 22, 26, 23, 29, 20,
-    29, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 22, 27, 23, 27, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    10, 10, 10, 10, 10, 10, 10, 10,
-    7, 26, 28, 28, 28, 28, 30, 30,
-    29, 30, 16, 24, 27, 21, 30, 29,
-    30, 27, 6, 6, 29, 16, 30, 26,
-    29, 6, 16, 25, 6, 6, 6, 26,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 15,
-    15, 15, 15, 15, 15, 15, 15, 27,
-    15, 15, 15, 15, 15, 15, 15, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 16,
-    16, 16, 16, 16, 16, 16, 16, 27,
-    16, 16, 16, 16, 16, 16, 16, 16
-};
-
-#endif
 
 /*
  * ----------------------------------------------------------------------
diff --git a/src/tools/tqunicodetables_p.h b/src/tools/tqunicodetables_p.h
index 1325c2478..0e5e71819 100644
--- a/src/tools/tqunicodetables_p.h
+++ b/src/tools/tqunicodetables_p.h
@@ -55,14 +55,9 @@
 #include "tqstring.h"
 #endif // QT_H
 
-#ifdef TQT_NO_UNICODETABLES
-# include <ctype.h>
-#endif
-
 class TQUnicodeTables {
 public:
     static const TQ_UINT8 unicode_info[];
-#ifndef TQT_NO_UNICODETABLES
     static const TQ_UINT16 decomposition_map[];
     static const TQ_UINT16 decomposition_info[];
     static const TQ_UINT16 ligature_map[];
@@ -74,9 +69,6 @@ public:
     static const TQ_UINT16 symmetricPairs[];
     static const int symmetricPairsSize;
     static const TQ_UINT8 line_break_info[];
-#else
-    static const TQ_UINT8 latin1_line_break_info[];
-#endif
     static const unsigned char otherScripts[];
     static const unsigned char indicScripts[];
     static const unsigned char scriptTable[];
@@ -97,19 +89,13 @@ public:
 
 inline TQChar::Category category( const TQChar &c )
 {
-#ifdef TQT_NO_UNICODETABLES
-    if ( c.unicode() > 0xff ) return TQChar::Letter_Uppercase; //########
-    return (TQChar::Category)TQUnicodeTables::unicode_info[c.unicode()];
-#else
     int uc = ((int)TQUnicodeTables::unicode_info[c.row()]) << 8;
     uc += c.cell();
     return (TQChar::Category)TQUnicodeTables::unicode_info[uc];
-#endif // TQT_NO_UNICODETABLES
 }
 
 inline TQChar lower( const TQChar &c )
 {
-#ifndef TQT_NO_UNICODETABLES
     int row = c.row();
     int cell = c.cell();
     int ci = TQUnicodeTables::case_info[row];
@@ -119,16 +105,10 @@ inline TQChar lower( const TQChar &c )
 	return c;
     TQ_UINT16 lower = TQUnicodeTables::case_info[(ci<<8)+cell];
     return lower ? TQChar(lower) : c;
-#else
-    if ( c.row() )
-	return c;
-    return TQChar( tolower((uchar) c.latin1()) );
-#endif
 }
 
 inline TQChar upper( const TQChar &c )
 {
-#ifndef TQT_NO_UNICODETABLES
     int row = c.row();
     int cell = c.cell();
     int ci = TQUnicodeTables::case_info[row];
@@ -138,39 +118,23 @@ inline TQChar upper( const TQChar &c )
 	return c;
     TQ_UINT16 upper = TQUnicodeTables::case_info[(ci<<8)+cell];
     return upper ? TQChar(upper) : c;
-#else
-    if ( c.row() )
-	return c;
-    return TQChar( toupper((uchar) c.latin1()) );
-#endif
 }
 
 inline TQChar::Direction direction( const TQChar &c )
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::direction_info[c.row()];
     return (TQChar::Direction) (TQUnicodeTables::direction_info[(pos<<8)+c.cell()] & 0x1f);
-#else
-    Q_UNUSED(c);
-    return TQChar::DirL;
-#endif
 }
 
 inline bool mirrored( const TQChar &c )
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::direction_info[c.row()];
     return TQUnicodeTables::direction_info[(pos<<8)+c.cell()] > 128;
-#else
-    Q_UNUSED(c);
-    return false;
-#endif
 }
 
 
 inline TQChar mirroredChar( const TQChar &ch )
 {
-#ifndef TQT_NO_UNICODETABLES
     if(!::mirrored( ch ))
 	return ch;
 
@@ -180,19 +144,13 @@ inline TQChar mirroredChar( const TQChar &ch )
 	if (TQUnicodeTables::symmetricPairs[i] == c)
 	    return TQUnicodeTables::symmetricPairs[(i%2) ? (i-1) : (i+1)];
     }
-#endif
     return ch;
 }
 
 inline TQChar::Joining joining( const TQChar &ch )
 {
-#ifndef TQT_NO_UNICODETABLES
     int pos = TQUnicodeTables::direction_info[ch.row()];
     return (TQChar::Joining) ((TQUnicodeTables::direction_info[(pos<<8)+ch.cell()] >> 5) &0x3);
-#else
-    Q_UNUSED(ch);
-    return TQChar::OtherJoining;
-#endif
 }
 
 inline bool isMark( const TQChar &ch )
@@ -203,13 +161,8 @@ inline bool isMark( const TQChar &ch )
 
 inline unsigned char combiningClass( const TQChar &ch )
 {
-#ifndef TQT_NO_UNICODETABLES
     const int pos = TQUnicodeTables::combining_info[ch.row()];
     return TQUnicodeTables::combining_info[(pos<<8) + ch.cell()];
-#else
-    Q_UNUSED(ch);
-    return 0;
-#endif
 }
 
 inline bool isSpace( const TQChar &ch )
@@ -221,13 +174,8 @@ inline bool isSpace( const TQChar &ch )
 
 inline int lineBreakClass( const TQChar &ch )
 {
-#ifdef TQT_NO_UNICODETABLES
-    return ch.row() ? TQUnicodeTables::LineBreak_AL
-	: TQUnicodeTables::latin1_line_break_info[ch.cell()];
-#else
     int pos = ((int)TQUnicodeTables::line_break_info[ch.row()] << 8) + ch.cell();
     return TQUnicodeTables::line_break_info[pos];
-#endif
 }
 
 inline int scriptForChar( ushort uc )
-- 
cgit v1.2.3

