mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-02 07:30:55 -08:00
Unicode character names can only be base strings -- notice this bug.
This commit is contained in:
parent
38cb221455
commit
6708d5e5ff
1 changed files with 13 additions and 10 deletions
|
|
@ -446,16 +446,19 @@ cl_object
|
|||
cl_name_char(cl_object name)
|
||||
{
|
||||
cl_object c = gethash_safe((name = cl_string(name)), cl_core.char_names, Cnil);
|
||||
if (c == Cnil && (name->base_string.self[0] == 'u' || name->base_string.self[0] == 'U')) {
|
||||
/* more error checking? FIXME */
|
||||
cl_index end = name->base_string.fillp - 1;
|
||||
cl_index real_end = end;
|
||||
c = parse_integer(name->base_string.self + 1, end,
|
||||
&real_end, 16);
|
||||
if ((real_end != end) || !FIXNUMP(c)) {
|
||||
c = Cnil;
|
||||
} else {
|
||||
c = CODE_CHAR(fix(c));
|
||||
if (c == Cnil && type_of(name) == t_base_string) {
|
||||
c = cl_char(name, MAKE_FIXNUM(0));
|
||||
if (c == CODE_CHAR('u') || c = CODE_CHAR('U')) {
|
||||
/* FIXME! This only works with base-strings */
|
||||
cl_index end = name->base_string.fillp - 1;
|
||||
cl_index real_end = end;
|
||||
c = parse_integer(name->base_string.self + 1, end,
|
||||
&real_end, 16);
|
||||
if ((real_end != end) || !FIXNUMP(c)) {
|
||||
c = Cnil;
|
||||
} else {
|
||||
c = CODE_CHAR(fix(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
@(return c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue