From 5a2de815cbc207d48a221f0eb0bebcfd8847ed58 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Fri, 16 Oct 2009 19:15:17 +0300 Subject: [PATCH] fixed bug in writing strings containing #\x85; and #\x2028;. --- scheme/ikarus.writer.ss | 4 +++- scheme/last-revision | 2 +- scheme/tests/reader.ss | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scheme/ikarus.writer.ss b/scheme/ikarus.writer.ss index aafdb91..1c43298 100644 --- a/scheme/ikarus.writer.ss +++ b/scheme/ikarus.writer.ss @@ -324,7 +324,9 @@ (write-char c p)] [(fx< b 127) (write-char c p)] - [(print-unicode) + [(or (fx= b #x85) (fx= b #x2028)) + (write-inline-hex b p)] + [(print-unicode) (write-char c p)] [else (write-inline-hex b p)])) diff --git a/scheme/last-revision b/scheme/last-revision index 8cd333f..8f9574f 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1860 +1861 diff --git a/scheme/tests/reader.ss b/scheme/tests/reader.ss index f11f6ba..cb6d27c 100644 --- a/scheme/tests/reader.ss +++ b/scheme/tests/reader.ss @@ -101,9 +101,19 @@ (define (run-tests) + (define (rw? x1) + (let ([str (let-values ([(p e) (open-string-output-port)]) + (write x1 p) + (e))]) + (let ([x2 (read (open-string-input-port str))]) + (equal? x1 x2)))) + (assert (rw? " \x85; ")) + (assert (rw? " \x2028; ")) + (test-char-syntax) (test-reader)) ) +