[Dev-luatex] string library with utf-8 support

Hans Hagen pragma at wxs.nl
Tue Oct 28 19:13:08 CET 2008


Olivier Binda wrote:
> Hello, I developped a Japanese dictionnary in XeTeX.
> It compiles just fine in luatex but I would like to code the commands in 
> Lua instead of TeX.
> To make the code faster, cleaner, simpler and more powerfull.
> 
> Yet, I need to be able to manipulate utf-8 strings (find, substring, 
> replace, length, etc...).
> Is there a simple way to do that in LUA ? Will there be one day a luatex 
> library for utf8 string managments ?
> (because it seems the string library is just for strings with 1 byte 
> characters and it is really lacking)

there is

	unicode.utf.gsub

etc

(you can also use lpeg which is 8 bit clean and for utf manipulations 
that' sgood enough)


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list