344 if (strcmp(p,"eucJP") == 0) { 345 /* For Solaris use customized vendor defined character 346 * customized EUC-JP converter 347 */ 348 *std_encoding = "eucJP-open"; 349 } else if (strcmp(p, "Big5") == 0 || strcmp(p, "BIG5") == 0) { 350 /* 351 * Remap the encoding string to Big5_Solaris which augments 352 * the default converter for Solaris Big5 locales to include 353 * seven additional ideographic characters beyond those included 354 * in the Java "Big5" converter. 355 */ 356 *std_encoding = "Big5_Solaris"; 357 } else if (strcmp(p, "Big5-HKSCS") == 0) { 358 /* 359 * Solaris uses HKSCS2001 360 */ 361 *std_encoding = "Big5-HKSCS-2001"; 362 } 363 #endif 364 } 365 366 free(temp); 367 free(encoding_variant); 368 369 return 1; 370 } 371 372 #ifdef JAVASE_EMBEDDED 373 /* Determine the default embedded toolkit based on whether libawt_xawt 374 * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX 375 */ 376 static char* getEmbeddedToolkit() { 377 Dl_info dlinfo; 378 char buf[MAXPATHLEN]; 379 int32_t len; 380 char *p; 381 struct stat statbuf; 382 383 /* Get address of this library and the directory containing it. */ | 344 if (strcmp(p,"eucJP") == 0) { 345 /* For Solaris use customized vendor defined character 346 * customized EUC-JP converter 347 */ 348 *std_encoding = "eucJP-open"; 349 } else if (strcmp(p, "Big5") == 0 || strcmp(p, "BIG5") == 0) { 350 /* 351 * Remap the encoding string to Big5_Solaris which augments 352 * the default converter for Solaris Big5 locales to include 353 * seven additional ideographic characters beyond those included 354 * in the Java "Big5" converter. 355 */ 356 *std_encoding = "Big5_Solaris"; 357 } else if (strcmp(p, "Big5-HKSCS") == 0) { 358 /* 359 * Solaris uses HKSCS2001 360 */ 361 *std_encoding = "Big5-HKSCS-2001"; 362 } 363 #endif 364 #ifdef MACOSX 365 /* 366 * For the case on MacOS X where encoding is set to US-ASCII, but we 367 * don't have any encoding hints from LANG/LC_ALL/LC_CTYPE, use UTF-8 368 * instead. 369 * 370 * The contents of ASCII files will still be read and displayed 371 * correctly, but so will files containing UTF-8 characters beyond the 372 * standard ASCII range. 373 * 374 * Specifically, this allows apps launched by double-clicking a .jar 375 * file to correctly read UTF-8 files using the default encoding (see 376 * 8011194). 377 */ 378 if (strcmp(p,"US-ASCII") == 0 && getenv("LANG") == NULL && 379 getenv("LC_ALL") == NULL && getenv("LC_CTYPE") == NULL) { 380 *std_encoding = "UTF-8"; 381 } 382 #endif 383 } 384 385 free(temp); 386 free(encoding_variant); 387 388 return 1; 389 } 390 391 #ifdef JAVASE_EMBEDDED 392 /* Determine the default embedded toolkit based on whether libawt_xawt 393 * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX 394 */ 395 static char* getEmbeddedToolkit() { 396 Dl_info dlinfo; 397 char buf[MAXPATHLEN]; 398 int32_t len; 399 char *p; 400 struct stat statbuf; 401 402 /* Get address of this library and the directory containing it. */ |