Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

19 Commits

Repository files navigation

lua-utf8string

Simple UTF8 support in pure lua

Current Status

The module emulate the string capabilities

  • string.byte
  • string.char
  • string.dump
  • string.find
  • string.format
  • string.gmatch
  • string.gsub
  • string.len
  • string.lower (*)
  • string.match
  • string.rep
  • string.reverse
  • string.sub
  • string.upper (*)

(*) don't thread Unicode, only ascii upper/lower cases.

Sample of use

localu=require("utf8string")
localdata="àbcdéêèf"localudata=u(data)
print(type(data), data) -- the orignalprint(type(udata), udata) -- automatic convertion to stringprint(#data) -- is not the good number of printed characters on screenprint(#udata) -- is the number of printed characters on screenprint(udata:sub(4,5)) -- be able to use the sub() like a string

TODO

  • See all other utf8 implementation
  • Try to follow the lua5.3's utf8 API
  • ...

License

My code is under MIT License

About

[#####] Simple UTF8 support in pure lua

Resources

Stars

34 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages