fix problem printing symbols with unicode chars

Specifically, special-casing letters (such as sigma) were not
handled correctly.

Merge to 5.2.1
This commit is contained in:
Matthew Flatt 2012-01-09 16:41:12 -07:00
parent 7b4fd9b275
commit 8b54dc43c8
2 changed files with 10 additions and 1 deletions

View File

@ -197,9 +197,18 @@
(f v o)
(get-output-string o)))])
(test "Π" in-string write 'Π) ;; UTF-8 encoding can be misinterpreted as having a space
(test "Σ" in-string write 'Σ) ;; interesting because it's special-casing
(test "ς" in-string write 'ς) ;; also special-casing
(test "σ" in-string write 'σ)
(test "|a\xA0b|" in-string write (string->symbol "a\xA0b"))
(parameterize ([read-case-sensitive #f])
(test "|Π|" in-string write 'Π)
(test "|Σ|" in-string write 'Σ)
(test "σ" in-string write 'σ)
(test "|ς|" in-string write 'ς))
(parameterize ([read-accept-bar-quote #f])
(test "Π" in-string write 'Π)
(test "Σ" in-string write 'Σ)
(test "a\\\xA0b" in-string write (string->symbol "a\xA0b"))))
(report-errs)

View File

@ -617,7 +617,7 @@ const char *scheme_symbol_name_and_size(Scheme_Object *sym, uintptr_t *length, i
ul++;
}
ch = buf[0];
if (scheme_isspecialcasing(ch)) {
if ((flags & SCHEME_SNF_NEED_CASE) && scheme_isspecialcasing(ch)) {
mzchar *rc;
buf[1] = 0;
rc = scheme_string_recase(buf, 0, 1, 3, 1, NULL);