Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The result of parsing UTF-16 encoded input lacks the last character #233

Closed
2 tasks done
fktn-k opened this issue Dec 2, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@fktn-k
Copy link
Owner

fktn-k commented Dec 2, 2023

Description

When UTF-16 encoded characters which do not end with a surrogate pair are passed for deserialization, the last character is not parsed.
While digging into the issue, it's turned out this is caused due to inadequate implementation of conversion from UTF-16 to UTF-8 which tries to take care of surrogate pairs.

Reproduction steps

Try parsing any UTF-16 encoded characters which do not end with a surrogate pair, like the following:

fkyaml::node n = fkyaml::node::deserialize(u"foo: bar");
std::cout << n << std::endl;

Expected vs. actual results

Expected output:

foo: bar

Actual output:

foo: ba

Minimal code example

The same as "Reproduction steps".

Error messages

No error messages.

Compiler and operating system

GCC 11.4.0 on Ubuntu 22.04 LTS

Library version

develop HEAD

Validation

@fktn-k
Copy link
Owner Author

fktn-k commented Dec 2, 2023

The bug reported in this issue has been fixed in #234.

@fktn-k fktn-k closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant