UTF support

Started by cormullion, December 30, 2007, 11:17:58 AM

Previous topic - Next topic

cormullion

Can a newLISP installation running on FreeBSD support Unicode (UTF)? I've noticed a difference between the way my local Lambdalator works and the way it works on the BDS system.



I can ask them to try Unicode if it's possible.

Lutz

#1
Depending on the features you want (i.e. explode, length, upper-case, lower-case reacting to wide characters instead of bytes) you would have to compile newLISP for UTF-8 on FreeBSD using: make -f makefile_bsd_utf8.



On the FreeBSD system I am running for newlisp.org, the compilation is not possible because of missing towupper() and towlower() C-functions support.



They may not be able to compile for it.



You also have to include the correct declaration in your webpage.



But what specifically are you observing?



Lutz

cormullion

#2
well the log shows that someone typed in this


(setq 愛 '(真実))

(it looked like this but the BB converts it to HTML UTF) - and I don't know how it survives its journey through the various newlisp and javascript functions

Lutz

#3
The non-UTF-8 version of newLISP will process UTF-8 strings as expected most of the time. But there are certain functions which will work differently, none of which the user typing in the UTF-8 characters used. There is a list of affected functions in the manual.



In most situations UTF-8 strings behave just like any other strings and are  manipulated without damage by newLISP, JavaScript or other scripting languages. Its only when starting to look at individual chracters, that there is a difference. In UTF-8 some characters are formed by more than one byte, and this gets important when displaying, counting, translating characters etc..



Lutz