Hi there. I've added support for UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE. Here's the new version of enc-unicode.lisp
Hello Dmitry,
On Sun, Oct 3, 2010 at 9:44 AM, Dmitry Ignatiev lovesan.ru@gmail.com wrote:
I've added support for UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE. Here's the new version of enc-unicode.lisp
Thanks for your patch. Do you think you could generalize the code generation a bit in order to avoid all that code repetition? If you don't have the inclination to do that, I'll probably apply your patch as is. Tests would be nice as well.
Cheers,
Alright, i've removed all that copy'n'paste code. Hope those new macros don't seem too weird. Btw, and also added UCS-2 variations. But no tests for now, sorry.
Oh, wait. There was a bug with code limit stuff and ucs-2. Here's the fixed version.
Btw, there was a bug in (define-decoder :utf-32) and (define-code-point-counter :utf-32)
At the beginning of that macros, the code that checks for BOM:
(case (,getter seq 0 4) ...
I suppose there must be "start"(as in utf-16 decoder/code-point-counter), not "0", in this form?
If so, that bug is in my code also. And so, this line in "make-bom-check-form" local function of "define-ucs" macro:
(case (,,getter ,,src 0 ,',bytes :ne)
should be replaced by this line:
(case (,,getter ,,src ,,start ,',bytes :ne)
any news on this?
i'd also need utf-16 with explicit byte order...
Oh, wait. There was a bug with code limit stuff and ucs-2. Here's the fixed version.
i have a whitespace-cleanup'd and darcs recorded patch of this, ready to be pushed.
Lius, if you give me the green light, then i can push it.
$ darcs push Pushing to "alendvai@common-lisp.net:/project/babel/public_html/darcs/babel/"... Thu Nov 4 14:33:36 CET 2010 Dmitry Ignatiev lovesan.ru@gmail.com * Added support for specifying endiannes for utf-16 and utf-32. Also fixed some utf-32 bugs.
Detailed discussion: http://thread.gmane.org/gmane.lisp.babel.devel/56 Shall I push this patch? (1/1) [ynW...], or ? for more options: