Opened 7 years ago

Closed 7 years ago

#948 closed defect (fixed)

encoding names

Reported by: pjb@… Owned by:
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc:

Description (last modified by rme)

There are inconsistencies in the documentation of the character sets http://ccl.clozure.com/ccl-documentation.html#Supported-Character-Encodings

:latin,3 instead of :latin-3 :cp68,7 instead of :cp68-8

on one hand, and on the other, inconsistencies in the naming of some character set, namely, why :latin-2 when the others are :latin1 :latin3 and :latin4 ?

cl-user> (dolist (cs '(:latin1 :latin2 :latin3 :latin4
                       :latin-1 :latin-2 :latin-3 :latin-4
                       :latin 3 
                       :cp63-7  :cp63 7))
           (handler-case 
               (progn
                 (close (open "/tmp/a.txt" :direction :probe :external-format cs))
                 (format t "~S~%" cs))
             (error (err)
               (format t "~S --> ~A~%" cs err))))
:latin1
:latin2 --> Invalid external-format: :latin2
:latin3
:latin4
:latin-1 --> Invalid external-format: :latin-1
:latin-2
:latin-3 --> Invalid external-format: :latin-3
:latin-4 --> Invalid external-format: :latin-4
:latin --> Invalid external-format: :latin
3 --> Invalid external-format: 3
:cp63-7 --> Invalid external-format: :cp63-7
:cp63 --> Invalid external-format: :cp63
7 --> Invalid external-format: 7
nil
cl-user> 

Another point, which is probably related, is that there's no introspection function to get the list of character sets and their aliases. Yes, there's a describe-character-encodings function but it gives a human readable string, that's in no way guaranteed to be parseable. I'd suggest a function returning a lisp a-list of name and aliases, so that programs can learn what encodings are supported by the current version of ccl. The documentation could then automatically be generated from this function, and no inconsistency would be to be expected.

Change History (3)

comment:1 Changed 7 years ago by rme

  • Description modified (diff)

comment:2 Changed 7 years ago by rme

(In [15299]) In the description of character encodings, change :latin-2 to :latin2. Correct typos in :latin3, :cp687.

(See ticket:948)

comment:3 Changed 7 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [15328]) Define and export ccl:list-character-encodings. Use it in ccl:describe-character-encodings.

Closes ticket:948.

Note: See TracTickets for help on using tickets.