Closed ghost closed 7 years ago
Is there a special option or setting to make it work?
Insert a Linux USB stick into your computer. The Windows version is broken as it basically handles wchar_t as USC-2, while in fact it is UTF-16. Using UTF-16 kind of bypasses the whole idea of using wchar_t in the first place: address characters as an array.
There are to ways out. One is to abandon Windows wchar_t, replace all wcs routines with our own that use USC-4 and support UTF-16 I/O conversion. The other is to migrate all internals to UTF-8 and adjust all code for dealing with the multibyte consequences thereof. It is not likely that any of this is going to happen any time soon unless some external developer or commercial party jumps in.
Added some tests. That indeed cannot hurt. Using type error now for > 0x10ffff and representation error for > 0xffff on Windows.
This issue has been mentioned on SWI-Prolog. There might be relevant details there:
https://swi-prolog.discourse.group/t/windows-unit-test-fails-for-semweb-ntriples/5197/1
I just got a new Windows 10 machine, and was testing some of the unicode functionality of SWI-Prolog. But somehow it doesn't work. Is there a special option or setting to make it work?
Here are some example issues:
1) atom_codes/2 doesn't throw error message, just takes modulo. Current observable behaviour:
Expected behaviour (one Deseret Character and one Mathematical Symbol) no modulo is taken:
2) Top level does not take modulo, but throws exception. Current observable behaviour:
Expected behaviour (one Deseret Character):
3) char_code/2 does not take modulo, but throws exception. Current observable behaviour:
Expected behaviour (one Mathematical Symbol):