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

ASF subversion and git services commented on MINIFI-193:
--------------------------------------------------------

Commit 070d8758fded4836f17816c1b1a34a48aa1bba20 in nifi-minifi-cpp's branch 
refs/heads/master from Marc Parisi
[ https://git-wip-us.apache.org/repos/asf?p=nifi-minifi-cpp.git;h=070d875 ]

MINIFI-193: Ensure safe UTF encoding

Since the C++ library is agnostic of UTF-8 we can safely write the bytes.
Since we won't be interpreting the UTF-8 code in the core library
we do not need any additional dependencies. Nor do we need to worry about
encoding beyond proper serialization and deserialization of the byte array.

This closes #68.

Signed-off-by: Aldrin Piri <[email protected]>


> writeUTF doesn't properly allow UTF-8 encoding
> ----------------------------------------------
>
>                 Key: MINIFI-193
>                 URL: https://issues.apache.org/jira/browse/MINIFI-193
>             Project: Apache NiFi MiNiFi
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: cpp-0.1.0
>            Reporter: marco polo
>            Assignee: marco polo
>            Priority: Blocker
>             Fix For: 0.2.0
>
>
> std::u16string should be used instead of std::string.
> The code that was copied and pasted into Provenance.cpp demonstrates this 
> problem. 
> {code:title=Provenance.cpp|borderStyle=solid}
> for (int i = 0; i < inLength; i++) {
>               int c = str.at(i);
> {code}
> Since the return of std::string::at is actually a car our max size is 0-255; 
> however, JAVA char is represented as a 16 bit unicode character whose value 
> can actually be > 0x07ff. We lose the data in translation if we were to use 
> these functions. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to