From 3c82da72c24b7360985ac8da21d1c2cb374711aa Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 5 Apr 2007 15:06:13 +0000 Subject: [PATCH] unicode-ize --- bindings/java/src/jni/win32/nls.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/jni/win32/nls.cpp b/bindings/java/src/jni/win32/nls.cpp index 67d9dbb2..ebb23465 100644 --- a/bindings/java/src/jni/win32/nls.cpp +++ b/bindings/java/src/jni/win32/nls.cpp @@ -17,6 +17,8 @@ */ #ifdef WIN32 +#define UNICODE +#define _UNICODE #include "win32bindings.h" #include "javasigar.h" @@ -34,14 +36,15 @@ JNIEXPORT jint SIGAR_JNI(win32_LocaleInfo_getSystemDefaultLCID) JNIEXPORT jstring SIGAR_JNI(win32_LocaleInfo_getAttribute) (JNIEnv *env, jclass objcls, jint lcid, jint attr) { - char value[8192]; + TCHAR value[8192]; int retval = GetLocaleInfo(lcid, attr, value, sizeof(value)); if (retval) { - return env->NewStringUTF(value); + int len = lstrlen(value); + return env->NewString((const jchar *)value, len); } else { return NULL;