[
https://issues.apache.org/jira/browse/MINIFI-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
marco polo updated MINIFI-193:
------------------------------
Description:
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.
was:
std::u16string should be used instead of std::string.
The code that was copied and pasted into Provenance.cpp demonstrates this
problem.
for (int i = 0; i < inLength; i++) {
int c = str.at(i);
Since the return of str.at(i) 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.
> writeUTF doesn't properly allow UTF16
> -------------------------------------
>
> Key: MINIFI-193
> URL: https://issues.apache.org/jira/browse/MINIFI-193
> Project: Apache NiFi MiNiFi
> Issue Type: Bug
> Components: C++
> Affects Versions: 0.1.0
> Reporter: marco polo
> Assignee: marco polo
> Priority: Blocker
>
> 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)