@@ -206,7 +206,29 @@ bool JvmLauncher::isVersionString(const char *str) {
206
206
return *end == ' \0 ' ;
207
207
}
208
208
209
- bool JvmLauncher::startInProcJvm (const char *mainClassName, std::list<std::string> args, std::list<std::string> options) {
209
+ bool JvmLauncher::startInProcJvm (const char *mainClassName, std::list<std::string> mbcs_args, std::list<std::string> mbcs_options) {
210
+
211
+ std::list<std::string> args;
212
+ for (std::list<std::string>::iterator it = mbcs_args.begin (); it != mbcs_args.end (); ++it) {
213
+ wchar_t wstr[2048 ];
214
+ UINT cp = AreFileApisANSI () ? CP_ACP : CP_OEMCP;
215
+ MultiByteToWideChar (cp, 0 , it->c_str (), -1 , wstr, sizeof (wstr) / sizeof (wchar_t ));
216
+ int mb_size = WideCharToMultiByte (CP_UTF8, 0 , wstr, -1 , NULL , 0 , NULL , NULL );
217
+ char *mbstr = (char *)malloc (mb_size);
218
+ WideCharToMultiByte (CP_UTF8, 0 , wstr, -1 , mbstr, mb_size, NULL , NULL );
219
+ args.push_back (mbstr);
220
+ }
221
+
222
+ std::list<std::string> options;
223
+ for (std::list<std::string>::iterator it = mbcs_options.begin (); it != mbcs_options.end (); ++it) {
224
+ wchar_t wstr[2048 ];
225
+ UINT cp = AreFileApisANSI () ? CP_ACP : CP_OEMCP;
226
+ MultiByteToWideChar (cp, 0 , it->c_str (), -1 , wstr, sizeof (wstr) / sizeof (wchar_t ));
227
+ int mb_size = WideCharToMultiByte (CP_UTF8, 0 , wstr, -1 , NULL , 0 , NULL , NULL );
228
+ char *mbstr = (char *)malloc (mb_size);
229
+ WideCharToMultiByte (CP_UTF8, 0 , wstr, -1 , mbstr, mb_size, NULL , NULL );
230
+ options.push_back (mbstr);
231
+ }
210
232
211
233
class Jvm {
212
234
public:
0 commit comments