[Bese-devel] encoding-keyword-to-native...

Attila Lendvai attila.lendvai at gmail.com
Sun Jul 2 10:00:19 UTC 2006


> Using openmcl (rel. 1.0) the function encoding-keyword-to-native
> (arnesi_dev, string.lisp)
> is undefined. I added it after the comment "Default Implementation",
> copying the sbcl code. I don't if it's correct.
>
> ...
> ;;;; *** Default Implementation
>
> #-(or (and sbcl sb-unicode) (and clisp unicode))
> (progn
>   (defun encoding-keyword-to-native (encoding)
>     (case encoding
>       (:utf-8 :utf8)
>       (:utf-16 :utf16)
>       (:us-ascii :us-ascii)
>       (t encoding)))
>   (defun %string-to-octets (string encoding)


it would be good if you could test its correctness and we could add it to
arnesi. try to find some openmcl docs/examples. is openmcl unicode ready at
all?

also make sure you use the latest version from:
ftp://clozure.com/pub/testing/

you can easily test it the result with lines like these:

(arnesi:write-string-to-file "áűüóé" #P"/tmp/x" :external-format :utf-8)
(arnesi:read-string-from-file #P"/tmp/x" :external-format :utf-8)


Then restarting UCW, I catch these error:
>
> 10:23 L10N-LOGGER/+INFO+: Loading locale from
> /Users/albertosantini/My/Dev/Lisp/ucw_libs/cl-l10n/locales/POSIX
> ; Warning: *resource-package* is not set, skipped loading resource
> file
> /Users/albertosantini/My/Dev/Lisp/ucw_libs/cl-l10n/resources/common.lisp
> ; While executing: LOAD-RESOURCE
> Read error between positions 769 and 1220 in
> /Users/albertosantini/My/Dev/Lisp/ucw_libs/cl-l10n/languages/common.lisp.
> > Error in process listener(1): Unknown character name -
> "LATIN_SMALL_LETTER_A_WITH_ACUTE" .
>
> Do I miss anything in my start.lisp for *resource-package*?


nope, that warning is normal. the resources are later reloaded when the
appropiate package (ucw.lang) is available.

the problem is that openmcl does not seem to understand utf character names.
you may safely comment out some of the character constants in
cl-l10n/languages/common.lisp (the hungarian plural will not work correctly.
but i guess you won't really care... :)

if you can send a patch or paste the part of the file that shows what is
unsupported on openmcl then i'll add it to the repos.

Thanks in advance?
> Alberto Santini


if you are looking for the easiest solution then just try another lisp, sbcl
should work if it's available.

hth,

-- 
- attila

"- The truth is that I've been too considerate, and so became
unintentionally cruel...
 - I understand.
 - No, you don't understand! We don't speak the same language!"

Ingmar Bergman - Smultronstället (Wild Strawberries)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060702/96cff43b/attachment.html>


More information about the bese-devel mailing list