<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm afraid at the moment Impromptu only fully supports 7-bit ASCII within the editor/interpreter.<br><br>However ...<br><br>The best way to handle non-english characters in impromptu is to use NSString - which gives you UTF. Additionally as of v1.4 (soon to be released) you can draw nsstrings and create paths from nsstrings (exactly as you do now but passing an nsstring). I have been using this recently to print multi-lingual graphics (across 20 languages).<br><br>Unfortunately this doesn't help you with string literals which are restricted to 7-bit ASCII. I have been thinking about adding UTF support to Impromptu but not sure about when this might happen. In the mean time nsstring should do everything you need.<br><br>Cheers,<br>Andrew.<br><br>;;<br>;; utf-8 example from impromptu v1.4<br>;; original utf8 Hankaku: アイウエオカキクケコサシスセソタチツテ<br>;;<br>(define canvas (gfx:make-canvas 350 100))<br>(gfx:clear-canvas (now) canvas '(0 0 0 1))<br>(define my-string (objc:call "NSString" "stringWithContentsOfFile:encoding:error:" "/tmp/japanese.txt" 4 0))<br>(gfx:draw-text (now) canvas my-string (gfx:make-text-style "Arial" 32 '(1 1 1 1)) '(20 20 350 50))<br><br><span><img height="100" width="354" src="cid:46134A82-3C39-4576-B457-8769D81CF3DC"></span><br><br><br><br>;; or more interestingly as a path<br>;; original utf8 Kanji てすと<br>(define text-path (gfx:make-text 100 100 "Hiragino Mincho Pro" 18 my-string))<br>(dotimes (i 10)<br> (gfx:draw-path (now) canvas text-path (list 1 0 0 1) (list (* .1 i) .1 (* i .1) .8) 2)<br> (gfx:scale-path (now) text-path 1.1 1.1 *gfx:centre-scale*)<br> (gfx:rotate-path (now) text-path 36 100 100 *degrees*))<br><br><br><br><span><img height="200" width="204" src="cid:BCB3944E-A748-49E7-8232-839F209CAAB3"></span><br><br><br><br><br>On 09/03/2009, at 4:37 AM, Glen F wrote:<br><br><blockquote type="cite"><font class="Apple-style-span" color="#000000">Hi there, I was wondering if there is any way to use non-English<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">characters in Impromptu. It seems to convert accented characters to<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">non-accented ones in string quoting...<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(define text "Pués, ¡bueno!")<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(print text)<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">This prints "Pues, !bueno!", having converted the 'é' and the '¡' to<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">'e' and '!' respectively...<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">I've managed to get a non-English string in several ways...for<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">example, loading in a text file that contains these characters. Or,<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">doing something like this:<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(define *e-acute* (integer->char 142))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(define *!-invert* (integer->char 193))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(define text (string-append "Pu" (string *e-acute*) "s, " (string *!-<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">invert*) "bueno!"))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(print text)<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">This prints the correct string. However, sadly, if I try to use<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">gfx:draw-text with such a string, I get nothing... Using gfx:add-<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">text to a path, I get the string with the special characters skipped.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(gfx:make-canvas))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(gfx:clear-canvas (now) *canvas* '(0 0 0 1))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(define *text-style* (gfx:make-text-style "Arial" 24.0 (list 1 1 1 1)))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">(gfx:draw-text (now) *canvas* text *text-style* '(50 50))<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Is there any way to be able to display non-English characters in<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Impromptu? I'm not asking for full multi-byte/Unicode character<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">support or anything, just a workaround (the ones I'm interested in<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">are still 8-bit ASCII characters)...<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Thanks,<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Glen.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">_______________________________________________<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Impromptu mailing list<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><a href="mailto:Impromptu@lists.moso.com.au">Impromptu@lists.moso.com.au</a><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><a href="http://lists.moso.com.au/mailman/listinfo/impromptu">http://lists.moso.com.au/mailman/listinfo/impromptu</a><br></font></blockquote><br></body></html>