1 diff --git sal/inc/osl/module.h sal/inc/osl/module.h
2 index 08888c4..3bc99a8 100644
3 --- sal/inc/osl/module.h
4 +++ sal/inc/osl/module.h
5 @@ -77,6 +77,12 @@ typedef void ( SAL_CALL *oslGenericFunction )( void );
7 oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMode);
9 +/** Load a shared library or module.
10 + @param pModuleName denotes the name of the module to be loaded.
11 + @return NULL if the module could not be loaded, otherwise a handle to the module.
13 +oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode);
15 /** Load a module located relative to some other module.
18 diff --git sal/osl/unx/module.c sal/osl/unx/module.c
19 index 874eb52..874f52c 100644
20 --- sal/osl/unx/module.c
21 +++ sal/osl/unx/module.c
22 @@ -70,8 +70,6 @@ int dladdr(void *address, Dl_info *dl)
23 /* implemented in file.c */
24 extern int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32);
26 -oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode);
28 /*****************************************************************************/
30 /*****************************************************************************/
31 @@ -92,7 +90,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo
32 char buffer[PATH_MAX];
34 if (UnicodeToText(buffer, PATH_MAX, ustrTmp->buffer, ustrTmp->length))
35 - pModule = osl_psz_loadModule(buffer, nRtldMode);
36 + pModule = osl_loadModuleAscii(buffer, nRtldMode);
37 rtl_uString_release(ustrTmp);
40 @@ -100,21 +98,21 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo
43 /*****************************************************************************/
44 -/* osl_psz_loadModule */
45 +/* osl_loadModuleAscii */
46 /*****************************************************************************/
48 -oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode)
49 +oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode)
52 (nRtldMode & SAL_LOADMODULE_LAZY) == 0 ||
53 (nRtldMode & SAL_LOADMODULE_NOW) == 0); /* only either LAZY or NOW */
57 #ifndef NO_DL_FUNCTIONS
59 ((nRtldMode & SAL_LOADMODULE_NOW) ? RTLD_NOW : RTLD_LAZY) |
60 ((nRtldMode & SAL_LOADMODULE_GLOBAL) ? RTLD_GLOBAL : RTLD_LOCAL);
61 - void* pLib = dlopen(pszModuleName, rtld_mode);
62 + void* pLib = dlopen(pModuleName, rtld_mode);
64 #if OSL_DEBUG_LEVEL > 1
66 diff --git sal/osl/unx/nlsupport.c sal/osl/unx/nlsupport.c
67 index c19a260..e6655bc 100644
68 --- sal/osl/unx/nlsupport.c
69 +++ sal/osl/unx/nlsupport.c
70 @@ -843,7 +843,6 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
71 /* OS X locale discovery function */
72 int (*pGetOSXLocale)( char *, sal_uInt32 );
74 -oslModule SAL_CALL osl_psz_loadModule(const sal_Char *pszModuleName, sal_Int32 nRtldMode);
75 /*****************************************************************************
76 return the current process locale
77 *****************************************************************************/
78 diff --git sal/osl/w32/module.c sal/osl/w32/module.c
79 index ba3a3be..b0116c3 100644
80 --- sal/osl/w32/module.c
81 +++ sal/osl/w32/module.c
82 @@ -82,6 +82,38 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod
85 /*****************************************************************************/
86 +/* osl_loadModuleAscii */
87 +/*****************************************************************************/
88 +oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nRtldMode )
90 + (void) nRtldMode; /* avoid warnings */
92 + HINSTANCE hInstance;
93 + UINT errorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
95 + oslFileError nError;
97 + RTL_LOGFILE_TRACE1( "{ osl_loadModule start: %s", pModuleName );
99 + OSL_ASSERT(pModuleName);
101 + hInstance = LoadLibrary(pModuleName);
102 + if (hInstance == NULL)
103 + hInstance = LoadLibraryEx(pModuleName, NULL,
104 + LOAD_WITH_ALTERED_SEARCH_PATH);
106 + if (hInstance <= (HINSTANCE)HINSTANCE_ERROR)
109 + ret = (oslModule) hInstance;
110 + SetErrorMode(errorMode);
112 + RTL_LOGFILE_TRACE1( "} osl_loadModule end: %s", pModuleName );
117 +/*****************************************************************************/
118 /* osl_getModuleHandle */
119 /*****************************************************************************/
121 diff --git sal/textenc/makefile.mk sal/textenc/makefile.mk
122 index b63aea0..32cf619 100644
123 --- sal/textenc/makefile.mk
124 +++ sal/textenc/makefile.mk
131 .INCLUDE: settings.mk
133 CFLAGS+= $(LFS_CFLAGS)
134 CXXFLAGS+= $(LFS_CFLAGS)
138 + $(SLO)$/tencinfo.obj \
139 + $(SLO)$/textcvt.obj \
140 + $(SLO)$/textenc.obj
142 +SAL_COMMON_OBJECTS = \
143 $(SLO)$/context.obj \
144 $(SLO)$/convertbig5hkscs.obj \
145 $(SLO)$/converter.obj \
146 @@ -53,12 +59,19 @@ SLOFILES = \
147 $(SLO)$/tcvtutf7.obj \
148 $(SLO)$/tcvtutf8.obj \
149 $(SLO)$/tenchelp.obj \
150 - $(SLO)$/tencinfo.obj \
151 - $(SLO)$/textcvt.obj \
152 - $(SLO)$/textenc.obj \
156 +SAL_TABLES_OBJECTS = \
159 +SLOFILES = $(SAL_OBJECTS) $(SAL_COMMON_OBJECTS) $(SAL_TABLES_OBJECTS)
162 + $(OBJ)$/tencinfo.obj \
163 + $(OBJ)$/textcvt.obj \
164 + $(OBJ)$/textenc.obj
166 +SAL_COMMON_OBJFILES = \
167 $(OBJ)$/context.obj \
168 $(OBJ)$/convertbig5hkscs.obj \
169 $(OBJ)$/converter.obj \
170 @@ -73,19 +86,36 @@ OBJFILES = \
171 $(OBJ)$/tcvtutf7.obj \
172 $(OBJ)$/tcvtutf8.obj \
173 $(OBJ)$/tenchelp.obj \
174 - $(OBJ)$/tencinfo.obj \
175 - $(OBJ)$/textcvt.obj \
176 - $(OBJ)$/textenc.obj \
179 +SAL_TABLES_OBJFILES = \
182 +OBJFILES = $(SAL_OBJFILES) $(SAL_COMMON_OBJFILES) $(SAL_TABLES_OBJFILES)
184 # Optimization off on Solaris Intel due to internal compiler error; to be
185 # reevaluated after compiler upgrade:
186 .IF "$(OS)$(CPU)" == "SOLARISI"
189 $(OBJ)$/textenc.obj \
190 - $(SLO)$/textenc.obj
191 + $(SLO)$/textenc.obj \
192 + $(OBJ)$/tables.obj \
195 .ENDIF # OS, CPU, SOLARISI
197 +LIB1TARGET= $(SLB)$/$(TARGET).lib
198 +LIB1OBJFILES= $(SAL_OBJECTS) $(SAL_COMMON_OBJECTS)
199 +OBJTARGET=$(LB)$/$(TARGET).lib
201 +# be nicer to avoid DLLPRE
202 +.IF "$(GUI)" == "WNT"
203 +CDEFS+=-DPLUGIN_NAME=$(DLLPRE)uno_sal_textenc$(UDK_MAJOR)$(DLLPOST)
205 +CDEFS+=-DPLUGIN_NAME=$(DLLPRE)uno_sal_textenc$(DLLPOST).$(UDK_MAJOR)
207 +LIB2TARGET= $(SLB)$/textenc_tables.lib
208 +LIB2OBJFILES= $(SAL_TABLES_OBJECTS) $(SAL_COMMON_OBJECTS)
211 diff --git sal/textenc/tables.cxx sal/textenc/tables.cxx
213 index 0000000..4816f3a
215 +++ sal/textenc/tables.cxx
217 +/*************************************************************************
219 + * OpenOffice.org - a multi-platform office productivity suite
225 + * last change: $Author$ $Date$
227 + * The Contents of this file are made available subject to
228 + * the terms of GNU Lesser General Public License Version 2.1.
231 + * GNU Lesser General Public License Version 2.1
232 + * =============================================
233 + * Copyright 2005 by Sun Microsystems, Inc.
234 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
236 + * This library is free software; you can redistribute it and/or
237 + * modify it under the terms of the GNU Lesser General Public
238 + * License version 2.1, as published by the Free Software Foundation.
240 + * This library is distributed in the hope that it will be useful,
241 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
242 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
243 + * Lesser General Public License for more details.
245 + * You should have received a copy of the GNU Lesser General Public
246 + * License along with this library; if not, write to the Free Software
247 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
248 + * MA 02111-1307 USA
250 + ************************************************************************/
252 +/* TODO! This file should not be called textenc.c, because it is not the
253 + implementation of rtl/textenc.h. Rather, it should be called
254 + gettextencodingdata.c. */
256 +#ifndef INCLUDED_RTL_TEXTENC_GETTEXTENCODINGDATA_H
257 +#include "gettextencodingdata.h"
260 +#ifndef INCLUDED_RTL_TEXTENC_TENCHELP_H
261 +#include "tenchelp.h"
264 +#ifndef _RTL_TEXTENC_H
265 +#include "rtl/textenc.h"
268 +#ifndef INCLUDED_STDDEF_H
270 +#define INCLUDED_STDDEF_H
273 +#define NOTABUNI_START 0xFF
274 +#define NOTABUNI_END 0x00
276 +#define NOTABCHAR_START 0xFFFF
277 +#define NOTABCHAR_END 0x0000
279 +#define SAME8090UNI_START 0x80
280 +#define SAME8090UNI_END 0x9F
281 +static sal_uInt16 const aImpl8090SameToUniTab[SAME8090UNI_END
282 + - SAME8090UNI_START
284 += { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, /* 0x80 */
285 + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
286 + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, /* 0x90 */
287 + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F };
289 +#define SAME8090CHAR_START 0x0080
290 +#define SAME8090CHAR_END 0x009F
291 +static sal_uChar const aImpl8090SameToCharTab[SAME8090CHAR_END
292 + - SAME8090CHAR_START
294 + = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x0080 */
295 + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
296 + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x0090 */
297 + 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F };
299 +#define SAMEA0FFCHAR_START 0x00A0
300 +#define SAMEA0FFCHAR_END 0x00FF
301 +static sal_uChar const aImplA0FFSameToCharTab[SAMEA0FFCHAR_END
302 + - SAMEA0FFCHAR_START
304 + = { 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, /* 0x00A0 */
305 + 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
306 + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, /* 0x00B0 */
307 + 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
308 + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 0x00C0 */
309 + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
310 + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, /* 0x00D0 */
311 + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
312 + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, /* 0x00E0 */
313 + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
314 + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 0x00F0 */
315 + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF };
317 +static sal_uInt16 const aImplDoubleByteIdentifierTab[1] = { 0 };
319 +#include "tcvtarb1.tab"
320 +#include "tcvteas1.tab"
321 +#include "tcvtest1.tab"
322 +#include "tcvtjp1.tab"
323 +#include "tcvtjp2.tab"
324 +#include "tcvtjp3.tab"
325 +#include "tcvtjp4.tab"
326 +#include "tcvtjp5.tab"
327 +#include "tcvtjp6.tab"
328 +#include "tcvtkr1.tab"
329 +#include "tcvtkr2.tab"
330 +#include "tcvtkr4.tab"
331 +#include "tcvtkr5.tab"
332 +#include "tcvtkr6.tab"
333 +#include "tcvtlat1.tab"
334 +#include "tcvtscn1.tab"
335 +#include "tcvtscn2.tab"
336 +#include "tcvtscn3.tab"
337 +#include "tcvtscn4.tab"
338 +#include "tcvtscn5.tab"
339 +#include "tcvtscn6.tab"
340 +#include "tcvtsym1.tab"
341 +#include "tcvttcn1.tab"
342 +#include "tcvttcn2.tab"
343 +#include "tcvttcn6.tab"
344 +#include "tcvtuni1.tab"
345 +#include "convertiscii.tab"
347 +#include "convertbig5hkscs.tab"
348 +#include "converteuctw.tab"
349 +#include "convertgb18030.tab"
350 +#include "convertiso2022cn.tab"
351 +#include "convertiso2022jp.tab"
352 +#include "convertiso2022kr.tab"
353 +#include "convertadobe.tab"
355 +ImplTextEncodingData const *
356 +Impl_getTextEncodingData(rtl_TextEncoding nEncoding)
358 + static ImplTextEncodingData const * const aData[]
359 + = { NULL, /* DONTKNOW */
360 + &aImplMS1252TextEncodingData, /* MS_1252 */
361 + &aImplAPPLEROMANTextEncodingData, /* APPLE_ROMAN */
362 + &aImplIBM437TextEncodingData, /* IBM_437 */
363 + &aImplIBM850TextEncodingData, /* IBM_850 */
364 + &aImplIBM860TextEncodingData, /* IBM_860 */
365 + &aImplIBM861TextEncodingData, /* IBM_861 */
366 + &aImplIBM863TextEncodingData, /* IBM_863 */
367 + &aImplIBM865TextEncodingData, /* IBM_865 */
368 + NULL, /* reserved (SYSTEM) */
369 + &aImplSYMBOLTextEncodingData, /* SYMBOL */
370 + &aImplUSASCIITextEncodingData, /* ASCII_US */
371 + &aImplISO88591TextEncodingData, /* ISO_8859_1 */
372 + &aImplISO88592TextEncodingData, /* ISO_8859_2 */
373 + &aImplISO88593TextEncodingData, /* ISO_8859_3 */
374 + &aImplISO88594TextEncodingData, /* ISO_8859_4 */
375 + &aImplISO88595TextEncodingData, /* ISO_8859_5 */
376 + &aImplISO88596TextEncodingData, /* ISO_8859_6 */
377 + &aImplISO88597TextEncodingData, /* ISO_8859_7 */
378 + &aImplISO88598TextEncodingData, /* ISO_8859_8 */
379 + &aImplISO88599TextEncodingData, /* ISO_8859_9 */
380 + &aImplISO885914TextEncodingData, /* ISO_8859_14 */
381 + &aImplISO885915TextEncodingData, /* ISO_8859_15 */
382 + &aImplIBM737TextEncodingData, /* IBM_737 */
383 + &aImplIBM775TextEncodingData, /* IBM_775 */
384 + &aImplIBM852TextEncodingData, /* IBM_852 */
385 + &aImplIBM855TextEncodingData, /* IBM_855 */
386 + &aImplIBM857TextEncodingData, /* IBM_857 */
387 + &aImplIBM862TextEncodingData, /* IBM_862 */
388 + &aImplIBM864TextEncodingData, /* IBM_864 */
389 + &aImplIBM866TextEncodingData, /* IBM_866 */
390 + &aImplIBM869TextEncodingData, /* IBM_869 */
391 + &aImplMS874TextEncodingData, /* MS_874 */
392 + &aImplMS1250TextEncodingData, /* MS_1250 */
393 + &aImplMS1251TextEncodingData, /* MS_1251 */
394 + &aImplMS1253TextEncodingData, /* MS_1253 */
395 + &aImplMS1254TextEncodingData, /* MS_1254 */
396 + &aImplMS1255TextEncodingData, /* MS_1255 */
397 + &aImplMS1256TextEncodingData, /* MS_1256 */
398 + &aImplMS1257TextEncodingData, /* MS_1257 */
399 + &aImplMS1258TextEncodingData, /* MS_1258 */
400 + NULL, /* TODO! APPLE_ARABIC */
401 + &aImplAPPLECENTEUROTextEncodingData, /* APPLE_CENTEURO */
402 + &aImplAPPLECROATIANTextEncodingData, /* APPLE_CROATIAN */
403 + &aImplAPPLECYRILLICTextEncodingData, /* APPLE_CYRILLIC */
404 + NULL, /* TODO! APPLE_DEVANAGARI */
405 + NULL, /* TODO! APPLE_FARSI */
406 + &aImplAPPLEGREEKTextEncodingData, /* APPLE_GREEK */
407 + NULL, /* TODO! APPLE_GUJARATI */
408 + NULL, /* TODO! APPLE_GURMUKHI */
409 + NULL, /* TODO! APPLE_HEBREW */
410 + &aImplAPPLEICELANDTextEncodingData, /* APPLE_ICELAND */
411 + &aImplAPPLEROMANIANTextEncodingData, /* APPLE_ROMANIAN */
412 + NULL, /* TODO! APPLE_THAI */
413 + &aImplAPPLETURKISHTextEncodingData, /* APPLE_TURKISH */
414 + &aImplAPPLEUKRAINIANTextEncodingData, /* APPLE_UKRAINIAN */
415 + &aImplAPPLECHINSIMPTextEncodingData, /* APPLE_CHINSIMP */
416 + &aImplAPPLECHINTRADTextEncodingData, /* APPLE_CHINTRAD */
417 + &aImplAPPLEJAPANESETextEncodingData, /* APPLE_JAPANESE */
418 + &aImplAPPLEKOREANTextEncodingData, /* APPLE_KOREAN */
419 + &aImplMS932TextEncodingData, /* MS_932 */
420 + &aImplMS936TextEncodingData, /* MS_936 */
421 + &aImplMS949TextEncodingData, /* MS_949 */
422 + &aImplMS950TextEncodingData, /* MS_950 */
423 + &aImplSJISTextEncodingData, /* SHIFT_JIS */
424 + &aImplGB2312TextEncodingData, /* GB_2312 */
425 + &aImplGBT12345TextEncodingData, /* GBT_12345 */
426 + &aImplGBKTextEncodingData, /* GBK */
427 + &aImplBIG5TextEncodingData, /* BIG5 */
428 + &aImplEUCJPTextEncodingData, /* EUC_JP */
429 + &aImplEUCCNTextEncodingData, /* EUC_CN */
430 + &aImplEucTwTextEncodingData, /* EUC_TW */
431 + &aImplIso2022JpTextEncodingData, /* ISO_2022_JP */
432 + &aImplIso2022CnTextEncodingData, /* ISO_2022_CN */
433 + &aImplKOI8RTextEncodingData, /* KOI8_R */
434 + &aImplUTF7TextEncodingData, /* UTF7 */
435 + &aImplUTF8TextEncodingData, /* UTF8 */
436 + &aImplISO885910TextEncodingData, /* ISO_8859_10 */
437 + &aImplISO885913TextEncodingData, /* ISO_8859_13 */
438 + &aImplEUCKRTextEncodingData, /* EUC_KR */
439 + &aImplIso2022KrTextEncodingData, /* ISO_2022_KR */
440 + &aImplJISX0201TextEncodingData, /* JIS_X_0201 */
441 + &aImplJISX0208TextEncodingData, /* JIS_X_0208 */
442 + &aImplJISX0212TextEncodingData, /* JIS_X_0212 */
443 + &aImplMS1361TextEncodingData, /* MS_1361 */
444 + &aImplGb18030TextEncodingData, /* GB_18030 */
445 + &aImplBig5HkscsTextEncodingData, /* BIG5_HKSCS */
446 + &aImplTis620TextEncodingData, /* TIS_620 */
447 + &aImplKoi8UTextEncodingData, /* KOI8_U */
448 + &aImplIsciiDevanagariTextEncodingData, /* ISCII_DEVANAGARI */
449 + &aImplJavaUtf8TextEncodingData, /* JAVA_UTF8 */
450 + &adobeStandardEncodingData, /* ADOBE_STANDARD */
451 + &adobeSymbolEncodingData, /* ADOBE_SYMBOL */
452 + &aImplPT154TextEncodingData }; /* PT154 */
454 + nEncoding < sizeof aData / sizeof aData[0] ? aData[nEncoding] : NULL;
457 --- sal/textenc/textenc.cxx
458 +++ sal/textenc/textenc.cxx
460 #include "gettextencodingdata.h"
461 #include "tenchelp.h"
462 #include "rtl/textenc.h"
463 +#include "rtl/ustring.hxx"
464 +#include "osl/module.h"
466 #ifndef INCLUDED_STDDEF_H
468 @@ -89,141 +91,69 @@ static sal_uChar const aImplA0FFSameToCharTab[SAMEA0FFCHAR_END
470 static sal_uInt16 const aImplDoubleByteIdentifierTab[1] = { 0 };
472 -#include "tcvtarb1.tab"
473 -#include "tcvteas1.tab"
474 #include "tcvtest1.tab"
475 -#include "tcvtjp1.tab"
476 -#include "tcvtjp2.tab"
477 -#include "tcvtjp3.tab"
478 -#include "tcvtjp4.tab"
479 -#include "tcvtjp5.tab"
480 -#include "tcvtjp6.tab"
481 -#include "tcvtkr1.tab"
482 -#include "tcvtkr2.tab"
483 -#include "tcvtkr4.tab"
484 -#include "tcvtkr5.tab"
485 -#include "tcvtkr6.tab"
486 #include "tcvtlat1.tab"
487 -#include "tcvtscn1.tab"
488 -#include "tcvtscn2.tab"
489 -#include "tcvtscn3.tab"
490 -#include "tcvtscn4.tab"
491 -#include "tcvtscn5.tab"
492 -#include "tcvtscn6.tab"
493 -#include "tcvtsym1.tab"
494 -#include "tcvttcn1.tab"
495 -#include "tcvttcn2.tab"
496 -#include "tcvttcn6.tab"
497 #include "tcvtuni1.tab"
498 -#include "convertiscii.tab"
500 -#include "convertbig5hkscs.tab"
501 -#include "converteuctw.tab"
502 -#include "convertgb18030.tab"
503 -#include "convertiso2022cn.tab"
504 -#include "convertiso2022jp.tab"
505 -#include "convertiso2022kr.tab"
506 -#include "convertadobe.tab"
508 + typedef ImplTextEncodingData const *(*TextEncodingFunction) (rtl_TextEncoding nEncoding);
511 +// Yes - we should use the unpleasant to use templatized
512 +// sal:: doublecheckfoo thing here.
513 +static TextEncodingFunction pTables;
515 +#define DOSTRING( x ) #x
516 +#define STRING( x ) DOSTRING( x )
518 ImplTextEncodingData const *
519 Impl_getTextEncodingData(rtl_TextEncoding nEncoding) SAL_THROW_EXTERN_C()
521 - static ImplTextEncodingData const * const aData[]
522 - = { NULL, /* DONTKNOW */
523 - &aImplMS1252TextEncodingData, /* MS_1252 */
524 - &aImplAPPLEROMANTextEncodingData, /* APPLE_ROMAN */
525 - &aImplIBM437TextEncodingData, /* IBM_437 */
526 - &aImplIBM850TextEncodingData, /* IBM_850 */
527 - &aImplIBM860TextEncodingData, /* IBM_860 */
528 - &aImplIBM861TextEncodingData, /* IBM_861 */
529 - &aImplIBM863TextEncodingData, /* IBM_863 */
530 - &aImplIBM865TextEncodingData, /* IBM_865 */
531 - NULL, /* reserved (SYSTEM) */
532 - &aImplSYMBOLTextEncodingData, /* SYMBOL */
533 - &aImplUSASCIITextEncodingData, /* ASCII_US */
534 - &aImplISO88591TextEncodingData, /* ISO_8859_1 */
535 - &aImplISO88592TextEncodingData, /* ISO_8859_2 */
536 - &aImplISO88593TextEncodingData, /* ISO_8859_3 */
537 - &aImplISO88594TextEncodingData, /* ISO_8859_4 */
538 - &aImplISO88595TextEncodingData, /* ISO_8859_5 */
539 - &aImplISO88596TextEncodingData, /* ISO_8859_6 */
540 - &aImplISO88597TextEncodingData, /* ISO_8859_7 */
541 - &aImplISO88598TextEncodingData, /* ISO_8859_8 */
542 - &aImplISO88599TextEncodingData, /* ISO_8859_9 */
543 - &aImplISO885914TextEncodingData, /* ISO_8859_14 */
544 - &aImplISO885915TextEncodingData, /* ISO_8859_15 */
545 - &aImplIBM737TextEncodingData, /* IBM_737 */
546 - &aImplIBM775TextEncodingData, /* IBM_775 */
547 - &aImplIBM852TextEncodingData, /* IBM_852 */
548 - &aImplIBM855TextEncodingData, /* IBM_855 */
549 - &aImplIBM857TextEncodingData, /* IBM_857 */
550 - &aImplIBM862TextEncodingData, /* IBM_862 */
551 - &aImplIBM864TextEncodingData, /* IBM_864 */
552 - &aImplIBM866TextEncodingData, /* IBM_866 */
553 - &aImplIBM869TextEncodingData, /* IBM_869 */
554 - &aImplMS874TextEncodingData, /* MS_874 */
555 - &aImplMS1250TextEncodingData, /* MS_1250 */
556 - &aImplMS1251TextEncodingData, /* MS_1251 */
557 - &aImplMS1253TextEncodingData, /* MS_1253 */
558 - &aImplMS1254TextEncodingData, /* MS_1254 */
559 - &aImplMS1255TextEncodingData, /* MS_1255 */
560 - &aImplMS1256TextEncodingData, /* MS_1256 */
561 - &aImplMS1257TextEncodingData, /* MS_1257 */
562 - &aImplMS1258TextEncodingData, /* MS_1258 */
563 - NULL, /* TODO! APPLE_ARABIC */
564 - &aImplAPPLECENTEUROTextEncodingData, /* APPLE_CENTEURO */
565 - &aImplAPPLECROATIANTextEncodingData, /* APPLE_CROATIAN */
566 - &aImplAPPLECYRILLICTextEncodingData, /* APPLE_CYRILLIC */
567 - NULL, /* TODO! APPLE_DEVANAGARI */
568 - NULL, /* TODO! APPLE_FARSI */
569 - &aImplAPPLEGREEKTextEncodingData, /* APPLE_GREEK */
570 - NULL, /* TODO! APPLE_GUJARATI */
571 - NULL, /* TODO! APPLE_GURMUKHI */
572 - NULL, /* TODO! APPLE_HEBREW */
573 - &aImplAPPLEICELANDTextEncodingData, /* APPLE_ICELAND */
574 - &aImplAPPLEROMANIANTextEncodingData, /* APPLE_ROMANIAN */
575 - NULL, /* TODO! APPLE_THAI */
576 - &aImplAPPLETURKISHTextEncodingData, /* APPLE_TURKISH */
577 - &aImplAPPLEUKRAINIANTextEncodingData, /* APPLE_UKRAINIAN */
578 - &aImplAPPLECHINSIMPTextEncodingData, /* APPLE_CHINSIMP */
579 - &aImplAPPLECHINTRADTextEncodingData, /* APPLE_CHINTRAD */
580 - &aImplAPPLEJAPANESETextEncodingData, /* APPLE_JAPANESE */
581 - &aImplAPPLEKOREANTextEncodingData, /* APPLE_KOREAN */
582 - &aImplMS932TextEncodingData, /* MS_932 */
583 - &aImplMS936TextEncodingData, /* MS_936 */
584 - &aImplMS949TextEncodingData, /* MS_949 */
585 - &aImplMS950TextEncodingData, /* MS_950 */
586 - &aImplSJISTextEncodingData, /* SHIFT_JIS */
587 - &aImplGB2312TextEncodingData, /* GB_2312 */
588 - &aImplGBT12345TextEncodingData, /* GBT_12345 */
589 - &aImplGBKTextEncodingData, /* GBK */
590 - &aImplBIG5TextEncodingData, /* BIG5 */
591 - &aImplEUCJPTextEncodingData, /* EUC_JP */
592 - &aImplEUCCNTextEncodingData, /* EUC_CN */
593 - &aImplEucTwTextEncodingData, /* EUC_TW */
594 - &aImplIso2022JpTextEncodingData, /* ISO_2022_JP */
595 - &aImplIso2022CnTextEncodingData, /* ISO_2022_CN */
596 - &aImplKOI8RTextEncodingData, /* KOI8_R */
597 - &aImplUTF7TextEncodingData, /* UTF7 */
598 - &aImplUTF8TextEncodingData, /* UTF8 */
599 - &aImplISO885910TextEncodingData, /* ISO_8859_10 */
600 - &aImplISO885913TextEncodingData, /* ISO_8859_13 */
601 - &aImplEUCKRTextEncodingData, /* EUC_KR */
602 - &aImplIso2022KrTextEncodingData, /* ISO_2022_KR */
603 - &aImplJISX0201TextEncodingData, /* JIS_X_0201 */
604 - &aImplJISX0208TextEncodingData, /* JIS_X_0208 */
605 - &aImplJISX0212TextEncodingData, /* JIS_X_0212 */
606 - &aImplMS1361TextEncodingData, /* MS_1361 */
607 - &aImplGb18030TextEncodingData, /* GB_18030 */
608 - &aImplBig5HkscsTextEncodingData, /* BIG5_HKSCS */
609 - &aImplTis620TextEncodingData, /* TIS_620 */
610 - &aImplKoi8UTextEncodingData, /* KOI8_U */
611 - &aImplIsciiDevanagariTextEncodingData, /* ISCII_DEVANAGARI */
612 - &aImplJavaUtf8TextEncodingData, /* JAVA_UTF8 */
613 - &adobeStandardEncodingData, /* ADOBE_STANDARD */
614 - &adobeSymbolEncodingData, /* ADOBE_SYMBOL */
615 - &aImplPT154TextEncodingData, /* PT154 */
616 - &adobeDingbatsEncodingData }; /* ADOBE_DINGBATS */
618 - nEncoding < sizeof aData / sizeof aData[0] ? aData[nEncoding] : NULL;
621 + case RTL_TEXTENCODING_ASCII_US:
622 + return &aImplUSASCIITextEncodingData; break;
623 + case RTL_TEXTENCODING_MS_1252:
624 + return &aImplMS1252TextEncodingData; break;
625 + case RTL_TEXTENCODING_UTF8:
626 + return &aImplUTF8TextEncodingData; break;
627 + case RTL_TEXTENCODING_ISO_8859_1:
628 + return &aImplISO88591TextEncodingData; break;
630 +#ifndef TOOLS_STRING_MISSUSE
631 +// ----------------------------------------------
632 +// These are here temporarily since they are used in error
633 +// all over the place
634 +// ----------------------------------------------
635 + case RTL_TEXTENCODING_IBM_850:
636 + return &aImplIBM850TextEncodingData; break;
637 + case RTL_TEXTENCODING_IBM_857:
638 + return &aImplIBM857TextEncodingData; break;
639 + case RTL_TEXTENCODING_IBM_860:
640 + return &aImplIBM860TextEncodingData; break;
641 + case RTL_TEXTENCODING_IBM_861:
642 + return &aImplIBM861TextEncodingData; break;
643 + case RTL_TEXTENCODING_IBM_863:
644 + return &aImplIBM863TextEncodingData; break;
645 +// ----------------------------------------------
650 + static char const pName[] = STRING(PLUGIN_NAME);
651 + oslModule aModule = osl_loadModuleAscii(pName, SAL_LOADMODULE_DEFAULT);
655 + static char const pSymbol[] = "Impl_getTextEncodingData";
656 + pTables = (TextEncodingFunction)osl_getAsciiFunctionSymbol(aModule, pSymbol);
660 + return pTables(nEncoding);
662 +// fprintf (stderr, "missing text encoding library for %d\n", nEncoding);
667 diff --git sal/util/makefile.mk sal/util/makefile.mk
668 index a8212fc..9a7ca6e 100644
669 --- sal/util/makefile.mk
670 +++ sal/util/makefile.mk
671 @@ -215,6 +215,15 @@ SHL1STDLIBS+=-lgcc
675 +SHL4DEPN+=$(SHL1TARGETN)
676 +SHL4LIBS=$(SLB)$/textenc_tables.lib
677 +SHL4TARGET=uno_sal_textenc
678 +SHL4STDLIBS=$(SALLIB)
679 +SHL4VERSIONMAP=saltextenc.map
681 +SHL4DEF=$(MISC)$/$(SHL4TARGET).def
682 +DEF4NAME=$(SHL4TARGET)
684 # --- Targets ------------------------------------------------------
686 .ENDIF # $(header) != ""
690 symlink: %_DEST%\lib%_EXT%\libuno_sal.so.3 %_DEST%\lib%_EXT%\libuno_sal.so
691 ..\%__SRC%\lib\libuno_sal.dylib.3 %_DEST%\lib%_EXT%\libuno_sal.dylib.3
692 symlink: %_DEST%\lib%_EXT%\libuno_sal.dylib.3 %_DEST%\lib%_EXT%\libuno_sal.dylib
693 +..\%__SRC%\lib\libuno_sal_textenc.so.3 %_DEST%\lib%_EXT%\libuno_sal_textenc.so.3
694 +symlink: %_DEST%\lib%_EXT%\libuno_sal_textenc.so.3 %_DEST%\lib%_EXT%\libuno_sal_textenc.so
695 ..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl
696 ..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
698 diff --git sal/util/sal.map sal/util/sal.map
699 index e5487a1..9fb2d08 100755
702 @@ -553,6 +553,7 @@ UDK_3.5 {
706 + osl_loadModuleAscii;
707 osl_getAsciiFunctionSymbol;
710 diff --git sal/util/saltextenc.map sal/util/saltextenc.map
712 index 0000000..8ce46c4
714 +++ sal/util/saltextenc.map
718 + Impl_getTextEncodingData;
722 diff --git scp2/source/ooo/ure.scp scp2/source/ooo/ure.scp
723 index fe77e2a..7bbec84 100755
724 --- scp2/source/ooo/ure.scp
725 +++ scp2/source/ooo/ure.scp
726 @@ -273,6 +273,13 @@ File gid_File_Dl_Sal
727 // CompID = "B1EF3AB6-611E-4027-958A-736583EB82E6";
730 +File gid_File_Dl_Sal_TextEnc
732 + Dir = SCP2_URE_DL_DIR;
733 + Name = SCP2_URE_DL_UNO_VER("sal_textenc", "3");
734 + Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
737 File gid_File_Dl_Salhelper
739 Dir = SCP2_URE_DL_DIR;