On 7/22/12, David A. Wheeler <[email protected]> wrote:
> So, here's what I plant to do.  First, I plan to define the following as the
> end-of-line characters:
>   <linefeed>, aka \n, U+000A
>   <carriage return>, aka \r, U+000D
>   <next line>, U+0085
>   <line separator>, U+2028

Guile 1.6 and 1.8 don't support Unicode out-of-box AFAIK.  On 2.0 the
encoding is done on a per-port basis using set-port-encoding!

On 2.0 there is also a file-encoding function that tries to autodetect
the file encoding somehow.  primitive-load is supposed to use this
function at the start (so I need to modify the primitive-load
replacement to detect 2.0 and do so).  The relevant manual section for
2.0: "If a port is used to read code of unknown character encoding, it
can accomplish this in three steps. First, the character encoding of
the port should be set to ISO-8859-1 using set-port-encoding!. Then,
the procedure file-encoding, described below, is used to scan for a
coding declaration when reading from the port. As a side effect, it
rewinds the port after its scan is complete. After that, the port's
character encoding should be set to the encoding returned by
file-encoding, if any, again by using set-port-encoding!. Then the
code can be read as normal. "

--

I think that Unicode support is sufficiently non-universal that
next-line and line-separator should probably go into the portability
layer.  For Scheme's that don't support Unicode out-of-box, define
those to be #f; if the Scheme supports Unicode, then preferentially
use (integer->char) as much as possible.  This should also allow us to
support Unicode on Guile 2.0 and disable that support in Guile
1.8/1.6, where character encodings are even bigger headaches and would
badly complicate the code if we forced the decoding.

Sincerely,
AmkG

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to