mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
library/string.m:
Define string.to_char_list and string.to_rev_char_list to either
replace code units in ill-formed sequences with U+FFFD or return
unpaired surrogate code points.
Use Mercury version of do_to_char_list instead of updating
the foreign language implementations.
tests/hard_coded/Mmakefile:
tests/hard_coded/string_char_list_ilseq.exp:
tests/hard_coded/string_char_list_ilseq.exp2:
tests/hard_coded/string_char_list_ilseq.m:
Add test case.
6 lines
111 B
Plaintext
6 lines
111 B
Plaintext
string.to_char_list
|
|
[a, b, c, 😀, 0xd83d, x, y, z]
|
|
|
|
string.to_rev_char_list
|
|
[z, y, x, 0xd83d, 😀, c, b, a]
|