-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
This issue is mostly duplicated with #144 but because of no rights to reopen I decided to post a new one to warn other users using non-latin codepages with JavaScriptCore datamodel
Steps to reproduce:
Conditions:
Windows any version, codepage 1251
Actions:
- Execute test-enc-UTF8.scxml
Results:
- We are getting Var14 from the data element
char* tmp = XERCESC_NS::XMLString::transcode(toTranscode);
_localForm = std::string(tmp);After conversion we have
std::string Var14 ="''В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!''"
It is ANSI 1251 string because method transcode transcodes a string to native code-page
Later we perform
JSStringRef scriptJS = JSStringCreateWithUTF8CString(expr.c_str());
JSValueRef exception = NULL;
JSValueRef result = JSEvaluateScript(_ctx, scriptJS, NULL, NULL, 0, &exception);And we are getting hard exception here because we have different size.
JSString expect UTF8 string which must be
std::string Var14="'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'
Possible Solutions
- Change everything to unicode std::wstring
- Modify
X(const XMLCh* const toTranscode)to force convert to UTF8 string - Convert from native code-page in datamodels
Metadata
Metadata
Assignees
Labels
No labels