Commit ac6c6b63 authored by Erick's avatar Erick

MacOs X Bug fix: isspace returns true for bytes beyond 0x80 even if we use UTF-8 encoding.

parent 65688d9e
......@@ -20,7 +20,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: ??-Oct-1993 ??:??
* Last file update: 19-Aug-2011 10:55 (eg)
* Last file update: 8-Oct-2011 16:09 (eg)
*
*/
......@@ -304,7 +304,9 @@ static SCM read_char(SCM port, int c)
for( ; ; ) {
tok[j++] = c;
c = STk_getc(port);
if (c == EOF || isspace((unsigned char)c)) break;
if (c == EOF || ((c <=0x80) && isspace((unsigned char)c)))
/* (c < 0x80) is for MacOs */
break;
if (strchr("()[]'`,;\"", c)) {
STk_ungetc(c, port);
break;
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 27-May-2011 23:35 (eg)
;;;; Last file update: 4-Sep-2011 17:55 (eg)
;;;; Last file update: 5-Oct-2011 22:15 (eg)
;;;;
(require "test")
......@@ -45,6 +45,8 @@
(test-subsection "Chibi Scheme unicode tests")
(test "prechibi.1" '(1056 1056 1091 1089 1089 1082 1080 1081)
(map char->integer (cons #\Р (string->list "Русский"))))
(test "chibi.1" #\Р (string-ref "Русский" 0))
(test "chibi.2" #\и (string-ref "Русский" 5))
(test "chibi.3" #\й (string-ref "Русский" 6))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment