-
Notifications
You must be signed in to change notification settings - Fork 518
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
Fix copied string corrupt when contain CJK glyphs #543
base: master
Are you sure you want to change the base?
Conversation
Technically this looks correct to me. But I am not sure we want to change the API from plain "buffer length" (which we do everywhere, so it is consistent) to UTF-8 specific buffer (which we do not do much if at all). What do others think here? If we settle on changing the API, could you also check all other demos to be consistent? |
I am not mean to change the API, but it seems people has mis-use this API, and passes glyphs instead of byte len to this method, so I have to rename the parameter 'len' to 'glyphs' |
And it's more complex to find out the byte len of the utf str for every call to it, so I sugget just change the byte len to glyths for easier use |
I noticed that the --stdC89 fails the CI in opengl3 build, can I change it to --stdC99 to fix this problem, or I change my code to adapt the C89 standard? |
We are totally fine with both (though we prefer C89 😉).
Just for my better understanding of your use case - can you make a one-line wrapper of the existing byte-API for your users?
Which language are you using Nuklear in? In most languages I know of (except for Swift and a very few others), byte-lengths are the default for (str)len methods/functions. |
Line 289 in 25b84d1
I search for the usage of the copy method, and find the only usage here. It passes glyphs of the selected string, not the byte length. |
Byte length of specific codepoint encoded in UTF-8 varies, the byte length of a 5 glyphs string may varies from 5 to 15. So you need to find out the byte length of the sub string for every call to the copy method. Isn't it more complex to introduce another substring method for utf8 string? |
No description provided.