unicode-ize

This commit is contained in:
Doug MacEachern 2007-04-05 15:06:13 +00:00
parent 676be63f35
commit 3c82da72c2
1 changed files with 5 additions and 2 deletions

View File

@ -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;