available encodings symbols strangeness; was: How to determine allowable external formats at run time

Robert Dodier <[email protected]>
Newsgroups gmane.editors.j.devel
Message-ID <CAAsY_sTm_anmWXALcNsKaj71g9QhQVEpqs8k+RnG9uJ2=M37Zw@mail.gmail.com>
Hi,

I've made some progress, but ran into a problem.

I see that SYSTEM:AVAILABLE-ENCODINGS returns a list of symbols which
represent the various encodings that are discovered via
Charset.availableCharsets. That's great, but the symbols are
apparently not interned in the keyword package, so it makes it
somewhat confusing to determine whether a given encoding is on the
list.

e.g. (member :utf-16 (system:available-encodings)) returns NIL,
although looking at the list, you can see that :UTF-16 is there.

Confusingly, (mapcar #'symbol-package (system:available-encodings))
shows that all symbols are in the keyword package, but (find-symbol
"UTF-16" :keyword) returns NIL.

I believe the problem is that availableEncodings in
src/org/armedbear/lisp/Stream.java says, in part, (at line 399 in the
current version)

new Symbol(charset, PACKAGE_KEYWORD)

but I think more appropriate would be

PACKAGE_KEYWORD.intern(charset)

or, at any rate, something to intern the charset symbol in the
package, since the Symbol constructor doesn't have that effect. What
does anyone think about that?

I tried to sign in to Trac to enter a bug report about this but wasn't
able. (1) "Login" wants a common-lisp.net user id -- I don't see a
method to obtain a user id on the common-lisp.net website. (2) "OpenId
login", clicked on Google, got: "Error in discovery: HTTP Response
status from identity URL host is not 200. Got status 404".

Hope this helps, and all the best.

Robert Dodier
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.