296 */
297 if (strcmp(p, "EUC-JP") == 0) {
298 *std_encoding = "EUC-JP-LINUX";
299 }
300 #endif
301
302 #ifdef _AIX
303 if (strcmp(p, "big5") == 0) {
304 /* On AIX Traditional Chinese Big5 codeset is mapped to IBM-950 */
305 *std_encoding = "IBM-950";
306 } else if (strcmp(p, "IBM-943") == 0) {
307 /*
308 * On AIX, IBM-943 is mapped to IBM-943C in which symbol 'yen' and
309 * 'overline' are replaced with 'backslash' and 'tilde' from ASCII
310 * making first 96 code points same as ASCII.
311 */
312 *std_encoding = "IBM-943C";
313 }
314 #endif
315
316 #ifdef __solaris__
317 if (strcmp(p,"eucJP") == 0) {
318 /* For Solaris use customized vendor defined character
319 * customized EUC-JP converter
320 */
321 *std_encoding = "eucJP-open";
322 } else if (strcmp(p, "Big5") == 0 || strcmp(p, "BIG5") == 0) {
323 /*
324 * Remap the encoding string to Big5_Solaris which augments
325 * the default converter for Solaris Big5 locales to include
326 * seven additional ideographic characters beyond those included
327 * in the Java "Big5" converter.
328 */
329 *std_encoding = "Big5_Solaris";
330 } else if (strcmp(p, "Big5-HKSCS") == 0) {
331 /*
332 * Solaris uses HKSCS2001
333 */
334 *std_encoding = "Big5-HKSCS-2001";
335 }
336 #endif
337 #ifdef MACOSX
338 /*
339 * For the case on MacOS X where encoding is set to US-ASCII, but we
340 * don't have any encoding hints from LANG/LC_ALL/LC_CTYPE, use UTF-8
341 * instead.
342 *
343 * The contents of ASCII files will still be read and displayed
344 * correctly, but so will files containing UTF-8 characters beyond the
345 * standard ASCII range.
346 *
347 * Specifically, this allows apps launched by double-clicking a .jar
348 * file to correctly read UTF-8 files using the default encoding (see
349 * 8011194).
350 */
351 const char* env_lang = getenv("LANG");
352 const char* env_lc_all = getenv("LC_ALL");
353 const char* env_lc_ctype = getenv("LC_CTYPE");
354
355 if (strcmp(p,"US-ASCII") == 0 &&
356 (env_lang == NULL || strlen(env_lang) == 0) &&
|
296 */
297 if (strcmp(p, "EUC-JP") == 0) {
298 *std_encoding = "EUC-JP-LINUX";
299 }
300 #endif
301
302 #ifdef _AIX
303 if (strcmp(p, "big5") == 0) {
304 /* On AIX Traditional Chinese Big5 codeset is mapped to IBM-950 */
305 *std_encoding = "IBM-950";
306 } else if (strcmp(p, "IBM-943") == 0) {
307 /*
308 * On AIX, IBM-943 is mapped to IBM-943C in which symbol 'yen' and
309 * 'overline' are replaced with 'backslash' and 'tilde' from ASCII
310 * making first 96 code points same as ASCII.
311 */
312 *std_encoding = "IBM-943C";
313 }
314 #endif
315
316 #ifdef MACOSX
317 /*
318 * For the case on MacOS X where encoding is set to US-ASCII, but we
319 * don't have any encoding hints from LANG/LC_ALL/LC_CTYPE, use UTF-8
320 * instead.
321 *
322 * The contents of ASCII files will still be read and displayed
323 * correctly, but so will files containing UTF-8 characters beyond the
324 * standard ASCII range.
325 *
326 * Specifically, this allows apps launched by double-clicking a .jar
327 * file to correctly read UTF-8 files using the default encoding (see
328 * 8011194).
329 */
330 const char* env_lang = getenv("LANG");
331 const char* env_lc_all = getenv("LC_ALL");
332 const char* env_lc_ctype = getenv("LC_CTYPE");
333
334 if (strcmp(p,"US-ASCII") == 0 &&
335 (env_lang == NULL || strlen(env_lang) == 0) &&
|