repair bytes-utf-8-ref
for #\xFFFF result
This commit is contained in:
parent
ea7452a3ed
commit
0cd7cdaa1f
|
@ -1724,4 +1724,10 @@
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(test #\uFFFF bytes-utf-8-ref #"\357\277\277" 0)
|
||||||
|
(test #f bytes-utf-8-ref #"\357\277" 0)
|
||||||
|
(test #\nul bytes-utf-8-ref #"\357\277" 0 #\nul)
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -1587,11 +1587,11 @@ byte_string_utf8_ref(int argc, Scheme_Object *argv[])
|
||||||
utf8_decode_x((unsigned char *)chars, istart, ifinish,
|
utf8_decode_x((unsigned char *)chars, istart, ifinish,
|
||||||
us, 0, 1,
|
us, 0, 1,
|
||||||
&ipos, &opos,
|
&ipos, &opos,
|
||||||
0, 0, NULL, 0, perm ? 0xFFFF : 0);
|
0, 0, NULL, 0, perm ? 0xFFFFFF : 0);
|
||||||
|
|
||||||
if (opos < 1)
|
if (opos < 1)
|
||||||
return scheme_false;
|
return scheme_false;
|
||||||
else if (us[0] == 0xFFFF)
|
else if (us[0] == 0xFFFFFF)
|
||||||
return perm;
|
return perm;
|
||||||
else
|
else
|
||||||
return scheme_make_character(us[0]);
|
return scheme_make_character(us[0]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user