-
Notifications
You must be signed in to change notification settings - Fork 149
CHR is only ansi; we need a CHRW function #451
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I have added code to my DWSTRING class to detect and repair broken surrogates. And they work transparently when DWSTRING is used with the FreeBasic intrinsic procedures and operators. Instead of DIM s AS STRING, you only need to do DIM dws AS DWSTRING and work in the same way that with the ansi strings.
|
True. I missed it. Thanks for changing the documentation. |
But my function ChrW remains useful because it works with high value codepoints. With WChr, to display the 128512 codepoint (😀) I have to use the concatenation of the high and the low surrogate pairs.
Whereas ChrW can display the codepoint
I have changed the code of ChrW to use WChr:
|
After achieving fully integration of my dynamic unicode string (DWSTRING), working with all the intrinsic FreeBasic string functions, I am attempting to solve the problem of unicode surrogate pairs and I already have code to do it when using my additional string functions (more than 30) The problem is that, as surrogates use two characters, when manipulating strings we can end breaking a surrogate by getting only half of it. The solution could be to check if the string to manipulate has surrogate pairs. If it has, they have to be replaced with unicode code points; once the string has been processed, these unicode points will be replaced with surrogate pairs. To do this last change, I needed to use CHR, but it is unusable for the purpose because it is only ansi. So I have needed to write my own:
Other functions that I have written to deal with the surrogates are:
An to check if the string has surrogates:
The text was updated successfully, but these errors were encountered: