From: <prn...@us...> - 2012-07-20 19:37:11
|
Revision: 10756 http://octave.svn.sourceforge.net/octave/?rev=10756&view=rev Author: prnienhuis Date: 2012-07-20 19:37:05 +0000 (Fri, 20 Jul 2012) Log Message: ----------- Restore the locale after initializing the JVM (S?\195?\169bastien Villemot) Modified Paths: -------------- trunk/octave-forge/extra/java/src/__java__.cc Modified: trunk/octave-forge/extra/java/src/__java__.cc =================================================================== --- trunk/octave-forge/extra/java/src/__java__.cc 2012-07-20 19:33:59 UTC (rev 10755) +++ trunk/octave-forge/extra/java/src/__java__.cc 2012-07-20 19:37:05 UTC (rev 10756) @@ -34,6 +34,8 @@ #include <iostream> #include <fstream> +#include <clocale> + typedef jint (JNICALL *JNI_CreateJavaVM_t) (JavaVM **pvm, JNIEnv **penv, void *args); typedef jint (JNICALL *JNI_GetCreatedJavaVMs_t) (JavaVM **pvm, jsize bufLen, jsize *nVMs); @@ -385,6 +387,9 @@ if (jvm) return; + const char *static_locale = setlocale(LC_ALL, NULL); + const std::string locale(static_locale); + #if defined (__WIN32__) HMODULE hMod = GetModuleHandle("jvm.dll"); @@ -534,6 +539,8 @@ } #endif + + setlocale(LC_ALL, locale.c_str()); } static void terminate_jvm(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |