[ https://issues.apache.org/jira/browse/GEODE-9412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17388206#comment-17388206 ]
ASF subversion and git services commented on GEODE-9412: -------------------------------------------------------- Commit 8a7436443629381b6be6142b6d2abf7187813309 in geode-native's branch refs/heads/develop from Blake Bender [ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=8a74364 ] GEODE-9412: Fix up marshaling of (potential) Unicode strings, where (#833) applicable - region names can be Unicode, cacheable keys/values, etc. Most of the rest don't need this, because they're never Unicode. Co-authored-by: Matthew Reddington <mredding...@vmware.com> > App crashes when translating string with certain Unicode characters > (exception thrown across managed/native boundary) > --------------------------------------------------------------------------------------------------------------------- > > Key: GEODE-9412 > URL: https://issues.apache.org/jira/browse/GEODE-9412 > Project: Geode > Issue Type: Bug > Components: native client > Reporter: Blake Bender > Priority: Major > Labels: pull-request-available > > tl;dr, we're not translating unicode correctly between .net and C++. > When a unicode string comes into the CLI layer, we use > `marshal_as<std::string>` to translate, then assume this yields UTF-8. In > fact, what it yields is a string encoded in a) whatever the local code page > is for the system, or b) the default code page for the app, if one exists in > the manifest. In the C++ layer, we then assume the string is UTF-8, and for > a PUT, attempt to translate into Java-modified UTF-8, which ends up throwing > an uncaught exception when it encounters a character that is not a valid > UTF-8 start code. When this exception hits the native/managed boundary, the > app crashes. > To avoid this issue, we need to `marshal_as<std::wstring>`, then use `std` > conversion functions to arrive at UTF-8, and pass that down to the C++ layer. > We also need to use the reverse process when sending strings back up to CLI. -- This message was sent by Atlassian Jira (v8.3.4#803005)