Files
mercury/tests/hard_coded/string_char_list_ilseq.exp2
Peter Wang 9b25e167e1 Define behaviour of string.to_char_list (and rev) on ill-formed sequences.
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.
2019-10-24 09:14:46 +11:00

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]