From c33db1470ec09c8d88c8b86721daff291bc635bb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 30 Jan 2013 11:26:58 +0000 Subject: [PATCH] 2013-01-30 12:25 UTC+0100 Viktor Szakats (harbour syenar.net) * src/codepage/cphr646.c * src/codepage/cpsl646.c * src/codepage/cpsr646.c ! fixed escape chars wrongly converted in prev commit * src/codepage/cpsr646c.c + converted to UTF-8. ; TODO: test it. * tests/cpinfo.prg + generate UTF-8 CP modules when using Harbour builds. ; NOTE: Now all CPs are using UTF-8 (#define HB_CP_UTF8) so now we may well delete the non-UTF-8 mode and the extra flag as well. --- harbour/ChangeLog.txt | 21 +++++++++++++++++++-- harbour/src/codepage/cphr646.c | 2 +- harbour/src/codepage/cpsl646.c | 2 +- harbour/src/codepage/cpsr646.c | 2 +- harbour/src/codepage/cpsr646c.c | 5 +++-- harbour/tests/cpinfo.prg | 8 ++++++++ 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 3b08188466..f178ef0053 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,23 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-01-30 12:25 UTC+0100 Viktor Szakats (harbour syenar.net) + * src/codepage/cphr646.c + * src/codepage/cpsl646.c + * src/codepage/cpsr646.c + ! fixed escape chars wrongly converted in prev commit + + * src/codepage/cpsr646c.c + + converted to UTF-8. + ; TODO: test it. + + * tests/cpinfo.prg + + generate UTF-8 CP modules when using Harbour builds. + + ; NOTE: Now all CPs are using UTF-8 (#define HB_CP_UTF8) + so now we may well delete the non-UTF-8 mode and + the extra flag as well. + 2013-01-30 10:34 UTC+0100 Viktor Szakats (harbour syenar.net) - src/codepage/cphuutf.c - deleted now obsolete sample @@ -110,11 +127,11 @@ * renamed all cp filenames to match internal CP ID ; NOTE: CP646C aka 'Serbian ISO-646C (Cyrillic YUSCII)' was not converted, and I have no idea what to do - with it. Do it if you know this. + with it. Do it if you know this. [DONE] ; Verify them. I was getting all sorts of initialization failures with non-UTF8 ones, after converting all of them, - I'm getting one for 'SR646'. + I'm getting one for 'SR646'. [DONE] ; If this settles, it offers interesting new possiblities, because most of the "CP" modules now essentially differ only in HB_CP_UNITB setting for a given country/language (=culture). diff --git a/harbour/src/codepage/cphr646.c b/harbour/src/codepage/cphr646.c index 8a42b56e4d..e756c8e41a 100644 --- a/harbour/src/codepage/cphr646.c +++ b/harbour/src/codepage/cphr646.c @@ -56,7 +56,7 @@ #define HB_CP_INFO "Croatian ISO-646 (CROSCII)" #define HB_CP_UNITB HB_UNITB_646YU #define HB_CP_ACSORT HB_CDP_ACSORT_NONE -#define HB_CP_UPPER "ABCČĆDĐĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" +#define HB_CP_UPPER "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" #define HB_CP_LOWER "abcčćdđefghijklmnopqrsštuvwxyzž" #define HB_CP_UTF8 diff --git a/harbour/src/codepage/cpsl646.c b/harbour/src/codepage/cpsl646.c index edd1d027d7..1ef721351d 100644 --- a/harbour/src/codepage/cpsl646.c +++ b/harbour/src/codepage/cpsl646.c @@ -55,7 +55,7 @@ #define HB_CP_INFO "Slovenian ISO-646 (SLOSCII)" #define HB_CP_UNITB HB_UNITB_646YU #define HB_CP_ACSORT HB_CDP_ACSORT_NONE -#define HB_CP_UPPER "ABCČĆDĐĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" +#define HB_CP_UPPER "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" #define HB_CP_LOWER "abcčćdđefghijklmnopqrsštuvwxyzž" #define HB_CP_UTF8 diff --git a/harbour/src/codepage/cpsr646.c b/harbour/src/codepage/cpsr646.c index 4e2a8ca660..dbe2e87e4f 100644 --- a/harbour/src/codepage/cpsr646.c +++ b/harbour/src/codepage/cpsr646.c @@ -54,7 +54,7 @@ #define HB_CP_INFO "Serbian ISO-646 (YUSCII)" #define HB_CP_UNITB HB_UNITB_646YU #define HB_CP_ACSORT HB_CDP_ACSORT_NONE -#define HB_CP_UPPER "ABCČĆDĐĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" +#define HB_CP_UPPER "ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽ" #define HB_CP_LOWER "abcčćdđefghijklmnopqrsštuvwxyzž" #define HB_CP_UTF8 diff --git a/harbour/src/codepage/cpsr646c.c b/harbour/src/codepage/cpsr646c.c index ebd8aad878..309199315b 100644 --- a/harbour/src/codepage/cpsr646c.c +++ b/harbour/src/codepage/cpsr646c.c @@ -54,8 +54,9 @@ #define HB_CP_INFO "Serbian ISO-646C (Cyrillic YUSCII)" #define HB_CP_UNITB HB_UNITB_646YUC #define HB_CP_ACSORT HB_CDP_ACSORT_NONE -#define HB_CP_UPPER "ABC^]D\\EFGHIJKLMNOPQRS[TUVWXYZ@" -#define HB_CP_LOWER "abc~}d|efghijklmnopqrs{tuvwxyz`" +#define HB_CP_UPPER "АБЦЧЋДЂЕФГХИЈКЛМНОПЉРСШТУВЊЏЅЗЖ" +#define HB_CP_LOWER "абцчћдђефгхијклмнопљрсштувњџѕзж" +#define HB_CP_UTF8 /* include CP registration code */ #include "hbcdpreg.h" diff --git a/harbour/tests/cpinfo.prg b/harbour/tests/cpinfo.prg index 48f046fd86..150dc8ef0f 100644 --- a/harbour/tests/cpinfo.prg +++ b/harbour/tests/cpinfo.prg @@ -434,10 +434,18 @@ static function genCPfile( id, info, unicode, flags, upper, lower, sort, ; if lMixed cDef += '#define HB_CP_CSSORT HB_CDP_CSSORT_MIXED' + EOL endif +#ifdef __HARBOUR__ + cDef += ; + '#define HB_CP_UPPER "' + hb_StrToUTF8( cUp ) + '"' + EOL + ; + '#define HB_CP_LOWER "' + hb_StrToUTF8( cLo ) + '"' + EOL + ; + '#define HB_CP_UTF8' + EOL + ; + EOL +#else cDef += ; '#define HB_CP_UPPER "' + cUp + '"' + EOL + ; '#define HB_CP_LOWER "' + cLo + '"' + EOL + ; EOL +#endif if lWarn cDef += ; '#if 0 /* TOVERIFY: binary tables */' + EOL