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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect string size of the constructor of tiny-utf8(not only use LITLEN) #70

Open
lencil opened this issue Jan 4, 2024 · 0 comments

Comments

@lencil
Copy link

lencil commented Jan 4, 2024

I've tested these cases (windows 11, msvc 2022 with ninja):

tiny_utf8::string utf8str(u8"q馃實");
utf8str.length() is 2.

but if you do this:

tiny_utf8::string utf8str(u8"q馃實\0\0");
utf8str.length() is 4.( This should be 2)

and if the c str is not a literal string but in memory string
the length of the utf8str is not always equal to strlen(cstr);

so I have to do like this:

const char *str = u8"q馃實\0\0";
tiny_utf8::string utf8str(str, strlen(str));
utf8str.length() is 2.
@lencil lencil changed the title Incorrect string size of the constructor of tiny-utf8 Incorrect string size of the constructor of tiny-utf8(not only use LITLEN) Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant