From 6fd1776d74727c7c2c30876fa73a183392308516 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Nov 2008 12:15:17 +0000 Subject: [PATCH] 2008-11-04 13:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * include/hbextern.ch * common.mak * source/codepage/Makefile * source/codepage/cpeswinm.c - source/codepage/cpes850.c + source/codepage/cpes850c.c * source/codepage/cpesiso.c + source/codepage/cpesisoc.c * source/codepage/cpeswin.c + source/codepage/cpeswinc.c * source/codepage/cpesisom.c * Spanish language support cleaned: Modern collation made the default, fixed CP linkage in ESWIN collations, Clipper compatibility versions renamed to have an ending 'C' Now the following collations are supported: ES850C - Clipper compatibility CP: IBM850 ESWINC - Clipper compatibility CP: Windows-1252 ESISOC - Clipper compatibility CP: ISO-8859-1 ESWIN - Modern CP: Windows-1252 ESISO - Modern CP: ISO-8859-1 ESMWIN - Compatibility with previous Harbour versions and xhb. (this collation has wrong linkage, so everyone is encouraged to use ESWIN or ESISO instead.) Intentionally not added to hbextern.ch. ; TODO: Add ES850. ; TODO: Check whether Clipper compatibility is indeed true. --- harbour/ChangeLog | 30 +++++ harbour/common.mak | 5 +- harbour/include/hbextern.ch | 6 +- harbour/source/codepage/Makefile | 5 +- .../source/codepage/{cpes850.c => cpes850c.c} | 20 ++-- harbour/source/codepage/cpesiso.c | 14 +-- .../codepage/{cpesisom.c => cpesisoc.c} | 22 ++-- harbour/source/codepage/cpeswin.c | 14 +-- harbour/source/codepage/cpeswinc.c | 104 ++++++++++++++++++ harbour/source/codepage/cpeswinm.c | 15 +-- 10 files changed, 186 insertions(+), 49 deletions(-) rename harbour/source/codepage/{cpes850.c => cpes850c.c} (88%) rename harbour/source/codepage/{cpesisom.c => cpesisoc.c} (88%) create mode 100644 harbour/source/codepage/cpeswinc.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cf1da2f5b8..662d30794e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,36 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-04 13:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * include/hbextern.ch + * common.mak + * source/codepage/Makefile + * source/codepage/cpeswinm.c + - source/codepage/cpes850.c + + source/codepage/cpes850c.c + * source/codepage/cpesiso.c + + source/codepage/cpesisoc.c + * source/codepage/cpeswin.c + + source/codepage/cpeswinc.c + * source/codepage/cpesisom.c + * Spanish language support cleaned: + Modern collation made the default, fixed + CP linkage in ESWIN collations, Clipper + compatibility versions renamed to have an + ending 'C' + Now the following collations are supported: + ES850C - Clipper compatibility CP: IBM850 + ESWINC - Clipper compatibility CP: Windows-1252 + ESISOC - Clipper compatibility CP: ISO-8859-1 + ESWIN - Modern CP: Windows-1252 + ESISO - Modern CP: ISO-8859-1 + ESMWIN - Compatibility with previous Harbour versions and xhb. + (this collation has wrong linkage, so everyone is + encouraged to use ESWIN or ESISO instead.) + Intentionally not added to hbextern.ch. + ; TODO: Add ES850. + ; TODO: Check whether Clipper compatibility is indeed true. + 2008-11-04 12:52 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/rddsql/mysqldd.c ! Excluded sizeof() in #ifdef to compile with MinGW. diff --git a/harbour/common.mak b/harbour/common.mak index 7289100fee..80f15b05ab 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -838,10 +838,11 @@ CODEPAGE_LIB_OBJS = \ $(OBJ_DIR)\cpdewin$(OBJEXT) \ $(OBJ_DIR)\cpel737$(OBJEXT) \ $(OBJ_DIR)\cpelwin$(OBJEXT) \ - $(OBJ_DIR)\cpes850$(OBJEXT) \ + $(OBJ_DIR)\cpes850c$(OBJEXT) \ $(OBJ_DIR)\cpesiso$(OBJEXT) \ - $(OBJ_DIR)\cpesisom$(OBJEXT) \ + $(OBJ_DIR)\cpesisoc$(OBJEXT) \ $(OBJ_DIR)\cpeswin$(OBJEXT) \ + $(OBJ_DIR)\cpeswinc$(OBJEXT) \ $(OBJ_DIR)\cpeswinm$(OBJEXT) \ $(OBJ_DIR)\cpfr850$(OBJEXT) \ $(OBJ_DIR)\cpfriso$(OBJEXT) \ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index f3b214bbaf..561fa11499 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -982,11 +982,11 @@ EXTERNAL HB_CODEPAGE_DEWIN EXTERNAL HB_CODEPAGE_EL737 EXTERNAL HB_CODEPAGE_ELWIN EXTERNAL HB_CODEPAGE_EN -EXTERNAL HB_CODEPAGE_ES850 +EXTERNAL HB_CODEPAGE_ES850C EXTERNAL HB_CODEPAGE_ESISO -EXTERNAL HB_CODEPAGE_ESISOM +EXTERNAL HB_CODEPAGE_ESISOC EXTERNAL HB_CODEPAGE_ESWIN -EXTERNAL HB_CODEPAGE_ESWINM +EXTERNAL HB_CODEPAGE_ESWINC EXTERNAL HB_CODEPAGE_FR850 EXTERNAL HB_CODEPAGE_FRISO EXTERNAL HB_CODEPAGE_FRWIN diff --git a/harbour/source/codepage/Makefile b/harbour/source/codepage/Makefile index c9df38c417..55818e33f9 100644 --- a/harbour/source/codepage/Makefile +++ b/harbour/source/codepage/Makefile @@ -18,10 +18,11 @@ C_SOURCES=\ cpdewin.c \ cpel737.c \ cpelwin.c \ - cpes850.c \ + cpes850c.c \ cpesiso.c \ - cpesisom.c \ + cpesisoc.c \ cpeswin.c \ + cpeswinc.c \ cpeswinm.c \ cpfr850.c \ cpfriso.c \ diff --git a/harbour/source/codepage/cpes850.c b/harbour/source/codepage/cpes850c.c similarity index 88% rename from harbour/source/codepage/cpes850.c rename to harbour/source/codepage/cpes850c.c index c5d0c5ec10..6eef354357 100644 --- a/harbour/source/codepage/cpes850.c +++ b/harbour/source/codepage/cpes850c.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * National Collation Support Module (ES850 - Spanish) + * National Collation Support Module (ES850C - Spanish Clipper compatible) * * Copyright 2002 Alexander S.Kresin * www - http://www.harbour-project.org @@ -75,7 +75,7 @@ /* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the accented characters with the symbol '~' before each of them, for example: - a~ + a~_ If there is two-character sequence, which is considered as one, it should be marked with '.' before and after it, for example: ... h.ch.i ... @@ -84,21 +84,21 @@ same excepting the characters case, of course. */ -static HB_CODEPAGE s_codepage = { "ES850", - HB_CPID_850, HB_UNITB_850, NUMBER_OF_CHARACTERS, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "abcdefghijklmnopqrstuvwxyz", - IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; +static HB_CODEPAGE s_codepage = { "ES850C", + HB_CPID_850, HB_UNITB_850, NUMBER_OF_CHARACTERS, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "abcdefghijklmnopqrstuvwxyz", + IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; -HB_CODEPAGE_INIT( ES850 ) +HB_CODEPAGE_INIT( ES850C ) #if defined( HB_PRAGMA_STARTUP ) - #pragma startup hb_codepage_Init_ES850 + #pragma startup hb_codepage_Init_ES850C #elif defined( HB_MSC_STARTUP ) #if defined( HB_OS_WIN_64 ) #pragma section( HB_MSC_START_SEGMENT, long, read ) #endif #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ES850 = hb_codepage_Init_ES850; + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ES850C = hb_codepage_Init_ES850C; #pragma data_seg() #endif diff --git a/harbour/source/codepage/cpesiso.c b/harbour/source/codepage/cpesiso.c index bd21c4ad41..c2eb000634 100644 --- a/harbour/source/codepage/cpesiso.c +++ b/harbour/source/codepage/cpesiso.c @@ -4,11 +4,11 @@ /* * Harbour Project source code: - * National Collation Support Module (ESISO - Spanish) + * National Collation Support Module (ESISO - Modern Spanish) * * Copyright 2002 Alexander S.Kresin * www - http://www.harbour-project.org - * Spanish support by Antonio Linares + * Spanish Windows support by Antonio Linares * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ * */ -/* Language name: Spanish */ +/* Language name: Spanish (Modern)*/ /* ISO language code (2 chars): ES */ /* Codepage: ISO-8859-1 */ @@ -59,7 +59,7 @@ #include "hbapi.h" #include "hbapicdp.h" -#define NUMBER_OF_CHARACTERS 33 /* The number of single characters in the +#define NUMBER_OF_CHARACTERS 43 /* The number of single characters in the alphabet, two-as-one aren't considered here, accented - are considered. */ #define IS_LATIN 1 /* Should be 1, if the national alphabet @@ -75,7 +75,7 @@ /* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the accented characters with the symbol '~' before each of them, for example: - a~ + a~_ If there is two-character sequence, which is considered as one, it should be marked with '.' before and after it, for example: ... h.ch.i ... @@ -86,8 +86,8 @@ static HB_CODEPAGE s_codepage = { "ESISO", HB_CPID_8859_1, HB_UNITB_8859_1, NUMBER_OF_CHARACTERS, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "abcdefghijklmnopqrstuvwxyz", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "abcdefghijklmnopqrstuvwxyz", IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; HB_CODEPAGE_INIT( ESISO ) diff --git a/harbour/source/codepage/cpesisom.c b/harbour/source/codepage/cpesisoc.c similarity index 88% rename from harbour/source/codepage/cpesisom.c rename to harbour/source/codepage/cpesisoc.c index 9a9fed7d04..b8af02f0f7 100644 --- a/harbour/source/codepage/cpesisom.c +++ b/harbour/source/codepage/cpesisoc.c @@ -4,11 +4,11 @@ /* * Harbour Project source code: - * National Collation Support Module (ESISOM - Modern Spanish) + * National Collation Support Module (ESISOC - Spanish Clipper compatible) * * Copyright 2002 Alexander S.Kresin * www - http://www.harbour-project.org - * Spanish Windows support by Antonio Linares + * Spanish support by Antonio Linares * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ * */ -/* Language name: Spanish (Modern)*/ +/* Language name: Spanish */ /* ISO language code (2 chars): ES */ /* Codepage: ISO-8859-1 */ @@ -59,7 +59,7 @@ #include "hbapi.h" #include "hbapicdp.h" -#define NUMBER_OF_CHARACTERS 43 /* The number of single characters in the +#define NUMBER_OF_CHARACTERS 33 /* The number of single characters in the alphabet, two-as-one aren't considered here, accented - are considered. */ #define IS_LATIN 1 /* Should be 1, if the national alphabet @@ -75,7 +75,7 @@ /* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the accented characters with the symbol '~' before each of them, for example: - a~ + a~_ If there is two-character sequence, which is considered as one, it should be marked with '.' before and after it, for example: ... h.ch.i ... @@ -84,21 +84,21 @@ same excepting the characters case, of course. */ -static HB_CODEPAGE s_codepage = { "ESISOM", +static HB_CODEPAGE s_codepage = { "ESISOC", HB_CPID_8859_1, HB_UNITB_8859_1, NUMBER_OF_CHARACTERS, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "abcdefghijklmnopqrstuvwxyz", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "abcdefghijklmnopqrstuvwxyz", IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; -HB_CODEPAGE_INIT( ESISOM ) +HB_CODEPAGE_INIT( ESISOC ) #if defined( HB_PRAGMA_STARTUP ) - #pragma startup hb_codepage_Init_ESISOM + #pragma startup hb_codepage_Init_ESISOC #elif defined( HB_MSC_STARTUP ) #if defined( HB_OS_WIN_64 ) #pragma section( HB_MSC_START_SEGMENT, long, read ) #endif #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ESISOM = hb_codepage_Init_ESISOM; + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ESISOC = hb_codepage_Init_ESISOC; #pragma data_seg() #endif diff --git a/harbour/source/codepage/cpeswin.c b/harbour/source/codepage/cpeswin.c index 8630a3f682..f2dfe95ab7 100644 --- a/harbour/source/codepage/cpeswin.c +++ b/harbour/source/codepage/cpeswin.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * National Collation Support Module (ESWIN - Spanish) + * National Collation Support Module (ESWIN - Modern Spanish) * * Copyright 2002 Alexander S.Kresin * www - http://www.harbour-project.org @@ -51,15 +51,15 @@ * */ -/* Language name: Spanish */ -/* ISO language code (2 chars): ES (please look it up in /doc/lang_id.txt) */ +/* Language name: Spanish (Modern)*/ +/* ISO language code (2 chars): ES */ /* Codepage: Windows-1252 */ #include #include "hbapi.h" #include "hbapicdp.h" -#define NUMBER_OF_CHARACTERS 33 /* The number of single characters in the +#define NUMBER_OF_CHARACTERS 43 /* The number of single characters in the alphabet, two-as-one aren't considered here, accented - are considered. */ #define IS_LATIN 1 /* Should be 1, if the national alphabet @@ -75,7 +75,7 @@ /* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the accented characters with the symbol '~' before each of them, for example: - a~ + a~_ If there is two-character sequence, which is considered as one, it should be marked with '.' before and after it, for example: ... h.ch.i ... @@ -86,8 +86,8 @@ static HB_CODEPAGE s_codepage = { "ESWIN", HB_CPID_1252, HB_UNITB_1252, NUMBER_OF_CHARACTERS, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "abcdefghijklmnopqrstuvwxyz", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "abcdefghijklmnopqrstuvwxyz", IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; HB_CODEPAGE_INIT( ESWIN ) diff --git a/harbour/source/codepage/cpeswinc.c b/harbour/source/codepage/cpeswinc.c new file mode 100644 index 0000000000..4765592c93 --- /dev/null +++ b/harbour/source/codepage/cpeswinc.c @@ -0,0 +1,104 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * National Collation Support Module (ESWINC - Spanish Clipper compatible) + * + * Copyright 2002 Alexander S.Kresin + * www - http://www.harbour-project.org + * Spanish Windows support by Antonio Linares + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +/* Language name: Spanish */ +/* ISO language code (2 chars): ES (please look it up in /doc/lang_id.txt) */ +/* Codepage: Windows-1252 */ + +#include +#include "hbapi.h" +#include "hbapicdp.h" + +#define NUMBER_OF_CHARACTERS 33 /* The number of single characters in the + alphabet, two-as-one aren't considered + here, accented - are considered. */ +#define IS_LATIN 1 /* Should be 1, if the national alphabet + is based on Latin */ +#define ACCENTED_EQUAL 0 /* Should be 1, if accented character + has the same weight as appropriate + unaccented. */ +#define ACCENTED_INTERLEAVED 0 /* Should be 1, if accented characters + sort after their unaccented counterparts + only if the unaccented versions of all + characters being compared are the same + ( interleaving ) */ + +/* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the + accented characters with the symbol '~' before each of them, for example: + a~_ + If there is two-character sequence, which is considered as one, it should + be marked with '.' before and after it, for example: + ... h.ch.i ... + + The Upper case string and the Lower case string should be absolutely the + same excepting the characters case, of course. + */ + +static HB_CODEPAGE s_codepage = { "ESWINC", + HB_CPID_1252, HB_UNITB_1252, NUMBER_OF_CHARACTERS, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "abcdefghijklmnopqrstuvwxyz", + IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; + +HB_CODEPAGE_INIT( ESWINC ) + +#if defined( HB_PRAGMA_STARTUP ) + #pragma startup hb_codepage_Init_ESWINC +#elif defined( HB_MSC_STARTUP ) + #if defined( HB_OS_WIN_64 ) + #pragma section( HB_MSC_START_SEGMENT, long, read ) + #endif + #pragma data_seg( HB_MSC_START_SEGMENT ) + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ESWINC = hb_codepage_Init_ESWINC; + #pragma data_seg() +#endif diff --git a/harbour/source/codepage/cpeswinm.c b/harbour/source/codepage/cpeswinm.c index 59b64b7e1b..821a9b7003 100644 --- a/harbour/source/codepage/cpeswinm.c +++ b/harbour/source/codepage/cpeswinm.c @@ -4,7 +4,8 @@ /* * Harbour Project source code: - * National Collation Support Module (ESWIN - Modern Spanish) + * National Collation Support Module (ESMWIN - Modern Spanish) + * (COMPATIBILITY - Use ESWIN or ESISO instead.) * * Copyright 2002 Alexander S.Kresin * www - http://www.harbour-project.org @@ -53,7 +54,7 @@ /* Language name: Spanish (Modern)*/ /* ISO language code (2 chars): ES */ -/* Codepage: Windows-1252 */ +/* Codepage: ISO-8859-1 */ #include #include "hbapi.h" @@ -84,21 +85,21 @@ same excepting the characters case, of course. */ -static HB_CODEPAGE s_codepage = { "ESWINM", - HB_CPID_1252, HB_UNITB_1252, NUMBER_OF_CHARACTERS, +static HB_CODEPAGE s_codepage = { "ESMWIN", + HB_CPID_8859_1, HB_UNITB_8859_1, NUMBER_OF_CHARACTERS, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", IS_LATIN, ACCENTED_EQUAL, ACCENTED_INTERLEAVED, 0, 0, NULL, NULL, NULL, NULL, 0, NULL }; -HB_CODEPAGE_INIT( ESWINM ) +HB_CODEPAGE_INIT( ESMWIN ) #if defined( HB_PRAGMA_STARTUP ) - #pragma startup hb_codepage_Init_ESWINM + #pragma startup hb_codepage_Init_ESMWIN #elif defined( HB_MSC_STARTUP ) #if defined( HB_OS_WIN_64 ) #pragma section( HB_MSC_START_SEGMENT, long, read ) #endif #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ESWINM = hb_codepage_Init_ESWINM; + static HB_$INITSYM hb_vm_auto_hb_codepage_Init_ESMWIN = hb_codepage_Init_ESMWIN; #pragma data_seg() #endif