[ 
https://issues.apache.org/jira/browse/GEODE-9412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17388207#comment-17388207
 ] 

ASF GitHub Bot commented on GEODE-9412:
---------------------------------------

pdxcodemonkey merged pull request #833:
URL: https://github.com/apache/geode-native/pull/833


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)

Reply via email to