please remove range test from chr()
please remove range test from chr()
please remove range test in the ide from chr()
Re: please remove range test from chr()
The range between $D800 and $DFFF is reserved for surrogate characters, so it shouldnt be used in Chr() as it doesnt returns a valid character.
Re: please remove range test from chr()
Please make it a soft warning rather than a compiler halt if you feel it's important. I only mentioned it as
It broke my 4000 line utf16 module.
It broke my 4000 line utf16 module.
Re: please remove range test from chr()
+1 for a warning instead of a fail
Norm
Norm
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: please remove range test from chr()
Could you explain why you need it to work as it doesn't return a valid character ? The error was added to spot this issue as a bug report was raised saying Chr() didn't work as expected.
Re: please remove range test from chr()
I think the test range was added, because Len(Chr($D800)) has given 2 instead of 1.
I any way didn't use Chr() since it doesn't work with the whole unicode character range up to $10FFFF.
However:
To generate surrogate pairs one can use PeekS() on a buffer with 4 bytes (the surrogate pair).
I any way didn't use Chr() since it doesn't work with the whole unicode character range up to $10FFFF.
However:
Based on this argument, you then should also check for other invalid characters like U+FFFE and U+FFFF or the NUL character, because it gives no string.Fred wrote: Mon Oct 16, 2023 10:25 pm The range between $D800 and $DFFF is reserved for surrogate characters, so it shouldnt be used in Chr() as it doesnt returns a valid character.
To generate surrogate pairs one can use PeekS() on a buffer with 4 bytes (the surrogate pair).
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: please remove range test from chr()
It does work for the whole unicode range with utf16 encoding which you can build on top of ucs2, which is how made the utf16 module.
I was just puzzled why and for what purpose. My understanding is that It's not the function chr place to check its the final render that's supposed to check and replace non printable chrs with □
I was just puzzled why and for what purpose. My understanding is that It's not the function chr place to check its the final render that's supposed to check and replace non printable chrs with □