//Traditional Chinese Windows should use MS950_HKSCS_XP as the //default encoding, if HKSCS patch has been installed. // "old" MS950 0xfa41 -> u+e001 // "new" MS950 0xfa41 -> u+92db if (strcmp(ret, "MS950") == 0) {
TCHAR mbChar[2] = {(char)0xfa, (char)0x41};
WCHAR unicodeChar;
MultiByteToWideChar(CP_ACP, 0, mbChar, 2, &unicodeChar, 1); if (unicodeChar == 0x92db) {
strcpy(ret, "MS950_HKSCS_XP");
}
} else { //SimpChinese Windows should use GB18030 as the default //encoding, if gb18030 patch has been installed (on windows //2000/XP, (1)Codepage 54936 will be available //(2)simsun18030.ttc will exist under system fonts dir ) if (strcmp(ret, "GBK") == 0 && IsValidCodePage(54936)) { char systemPath[MAX_PATH + 1]; char* gb18030Font = "\\FONTS\\SimSun18030.ttc";
FILE *f = NULL; if (GetWindowsDirectory(systemPath, MAX_PATH + 1) != 0 &&
strlen(systemPath) + strlen(gb18030Font) < MAX_PATH + 1) {
strcat(systemPath, "\\FONTS\\SimSun18030.ttc"); if ((f = fopen(systemPath, "r")) != NULL) {
fclose(f);
strcpy(ret, "GB18030");
}
}
}
}
// Returns BCP47 Language Tag
DllExport constchar *
getJavaIDFromLangID(LANGID langID)
{ char * elems[5]; // lang, script, ctry, variant, encoding char * ret; int index;
ret = malloc(SNAMESIZE); if (ret == NULL) { return NULL;
}
for (index = 0; index < 5; index++) {
elems[index] = NULL;
}
if (SetupI18nProps(MAKELCID(langID, SORT_DEFAULT),
&(elems[0]), &(elems[1]), &(elems[2]), &(elems[3]), &(elems[4]))) {
// there always is the "language" tag
strcpy(ret, elems[0]);
// append other elements, if any for (index = 1; index < 4; index++) { if ((elems[index])[0] != '\0') {
strcat(ret, "-");
strcat(ret, elems[index]);
}
}
} else {
free(ret);
ret = NULL;
}
for (index = 0; index < 5; index++) { if (elems[index] != NULL) {
free(elems[index]);
}
}
/* fallback solution for WinXP and Windows 2000 */
hr = SHGetFolderPathW(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, path); if (FAILED(hr)) { /* we can't find the shell folder. */
u_path = NULL;
} else { /* Just to be sure about the path length until Windows Vista approach. *[S_FALSE]couldnotbereturneddueto[CSIDL_FLAG_DONT_VERIFY]flagandUNICODEversion.
*/
path[MAX_PATH] = 0;
u_path = _wcsdup(path);
}
}
} return u_path;
}
// GetVersionEx is deprecated; disable the warning until a replacement is found #pragma warning(disable : 4996)
java_props_t *
GetJavaProperties(JNIEnv* env)
{ static java_props_t sprops = {0}; int majorVersion; int minorVersion; int buildNumber = 0;
if (sprops.line_separator) { return &sprops;
}
/* tmp dir */
{
WCHAR tmpdir[MAX_PATH + 1]; /* we might want to check that this succeed */
GetTempPathW(MAX_PATH + 1, tmpdir);
sprops.tmp_dir = _wcsdup(tmpdir);
}
is_64bit = (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64);
} do { // Read the major and minor version number from kernel32.dll
VS_FIXEDFILEINFO *file_info;
WCHAR kernel32_path[MAX_PATH];
DWORD version_size;
LPTSTR version_info;
UINT len, ret;
// Get the full path to \Windows\System32\kernel32.dll and use that for // determining what version of Windows we're running on.
len = MAX_PATH - (UINT)strlen("\\kernel32.dll") - 1;
ret = GetSystemDirectoryW(kernel32_path, len); if (ret == 0 || ret > len) { break;
}
wcsncat(kernel32_path, L"\\kernel32.dll", MAX_PATH - ret);
// Windows UI Language selection list only cares "language" // information of the UI Language. For example, the list // just lists "English" but it actually means "en_US", and // the user cannot select "en_GB" (if exists) in the list. // So, this hack is to use the user LCID region information // for the UI Language, if the "language" portion of those // two locales are the same. if (PRIMARYLANGID(LANGIDFROMLCID(userDefaultLCID)) ==
PRIMARYLANGID(userDefaultUILang)) {
userDefaultUILCID = userDefaultLCID;
}
sprops.sun_jnu_encoding = getEncodingInternal(0); if (sprops.sun_jnu_encoding == NULL) {
sprops.sun_jnu_encoding = "UTF-8";
} if (LANGIDFROMLCID(userDefaultLCID) == 0x0c04 && majorVersion == 6) { // MS claims "Vista has built-in support for HKSCS-2004. // All of the HKSCS-2004 characters have Unicode 4.1. // PUA code point assignments". But what it really means // is that the HKSCS-2004 is ONLY supported in Unicode. // Test indicates the MS950 in its zh_HK locale is a // "regular" MS950 which does not handle HKSCS-2004 at // all. Set encoding to MS950_HKSCS.
sprops.encoding = "MS950_HKSCS";
sprops.sun_jnu_encoding = "MS950_HKSCS";
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.18Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.