From 2bd3b2bd9ff3dac7484692972740d37a6ecb5577 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 3 Jul 2003 16:47:49 +0000 Subject: [PATCH] Emit non-ASCII chars using &#...; notation. --- v7/src/xml/xml-output.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/v7/src/xml/xml-output.scm b/v7/src/xml/xml-output.scm index 54e971260..972cdcdd8 100644 --- a/v7/src/xml/xml-output.scm +++ b/v7/src/xml/xml-output.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: xml-output.scm,v 1.18 2003/03/09 17:17:06 cph Exp $ +$Id: xml-output.scm,v 1.19 2003/07/03 16:47:49 cph Exp $ Copyright 2001,2002,2003 Massachusetts Institute of Technology @@ -60,7 +60,13 @@ USA. (apply %make-ctx 'PORT port options)) (define (emit-char char ctx) - (write-char char (ctx-port ctx))) + (let ((port (ctx-port ctx))) + (if (fix:< (char->integer char) #x80) + (write-char char port) + (begin + (write-string "&#x" port) + (write-string (number->string (char->integer char) 16) port) + (write-string ";" port))))) (define (emit-string string ctx) (write-string string (ctx-port ctx))) -- 2.25.1