#36: file-position broken for utf16 and utf32
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone:
Component: Core | Version: 19f
Keywords: |
--------------------+-------------------------------------------------------
Consider this code:
{{{
(defun bug (&optional (format :utf16))
(with-open-file (s "/tmp/bom.txt"
:direction :output
:if-exists :supersede
:external-format format)
(format s "Hello~%"))
(with-open-file (s "/tmp/bom.txt"
:direction :input
:external-format format)
(print (read-char s))
(print (file-position s)))
(values))
}}}
Running {{{(bug :utf16)}}} produces
{{{
#\H
2
}}}
{{{(bug :utf32)}}} produces
{{{
#\H
4
}}}
In both cases, the actual position is wrong. For utf16, the position
should 4; utf32, 8. The BOM has been ignored.
This is caused by {{{STRING-ENCODE}}} outputting the BOM for these
formats. {{{STRING-ENCODE)}}} is used to figure out how many octets have
not yet been processed but have been read from the file. If the BOM was
not output, the position would be correct.
This bug (will) occur in the 2010-02 snapshot and later.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/36>
cmucl <http://common-lisp.net/project/cmucl>
cmucl
#39: non-standard lexical syntax
--------------------+-------------------------------------------------------
Reporter: heller | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: Core | Version: 2010-04
Keywords: |
--------------------+-------------------------------------------------------
When I first heard about the i18n stuff, piglatin, and Google
translated Korean I thought this was an April Fool's joke. But
apparently it's serious. Now I get this:
{{{
CMU Common Lisp Snapshot 2010-04 (20A Unicode), running on ix
* '(_"x")
((INTL:GETTEXT "x"))
*
}}}
Can you please fix the initial readtable so that it's free of such
silliness?
I'm also disappointed that this (mis)feature was added in such an
intrusive way: essentially every file was changed and is now riddled
with non standard reader macros.
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/39>
cmucl <http://common-lisp.net/project/cmucl>
cmucl