[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MIT-Scheme-users] Re: *parser and UTF-8
From: |
Chris Hanson |
Subject: |
[MIT-Scheme-users] Re: *parser and UTF-8 |
Date: |
Thu, 29 Jun 2006 15:18:04 -0400 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060619) |
Kaloian Doganov wrote:
> (call-with-input-file "sample-data.txt"
> (lambda (port)
> (display ((*parser (seq (match (* (alphabet full-alphabet)))))
> (input-port->parser-buffer port)))))
> ----------8<----------
>
> should display:
>
> #(Когато бях овчарче и овците пасях
> )
>
> but it displays:
>
> #(ÐогаÑо бÑÑ
овÑаÑÑе и овÑиÑе паÑÑÑ
...
> )
>
> Which looks like UTF-8 byte sequence parsed as ISO-8859-1. Or perhaps
> the data itself is parsed properly, but the `display' procedure is not
> capable to handle it?
>
> What I am doing wrong?
By default, ports start in a simple coding -- you need to switch the
coding after the port is opened:
(call-with-input-file "sample-data.txt"
(lambda (port)
(port/set-coding port 'utf-8)
...)))
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, (continued)
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Kaloian Doganov, 2006/06/29
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Kaloian Doganov, 2006/06/29
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Chris Hanson, 2006/06/29
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Kaloian Doganov, 2006/06/29
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Chris Hanson, 2006/06/29
- Re: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Kaloian Doganov, 2006/06/30
- [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com, Chris Hanson, 2006/06/29
- Staging problem (was: [MIT-Scheme-users] ../microcode/scheme: can't read option file: --fasl make.com), Kaloian Doganov, 2006/06/29
- [MIT-Scheme-users] Re: Staging problem, Chris Hanson, 2006/06/29
- [MIT-Scheme-users] *parser and UTF-8 (was: Staging problem), Kaloian Doganov, 2006/06/29
- [MIT-Scheme-users] Re: *parser and UTF-8,
Chris Hanson <=
- [MIT-Scheme-users] Re: *parser and UTF-8, Kaloian Doganov, 2006/06/29