Hacker News new | ask | show | jobs
by marshray 5258 days ago
I'm fine with C-style strings, but once in a while there are things for which a bit of UTF-8 tagging would be good enough.
1 comments

Lua strings aren't C-style: they're prefixed with the string length. Lua's strings are suitable enough to store UTF-8 encoded data, but none of Lua's built-in functions are equipped to process it. Unicode libraries don't need to provide a special Unicode string type, they simply need to provide Unicode-aware string processing functions.
Right. I meant "C-style" in the sense of Lua being oriented around the kind of single/multibyte encodings used with ANSI C (as contrasted with kind of the UCS-2 and UTF-16 stuff you get with Win32 and Java).