3 ms·
Is Unicode ever a problem when you do real-life web development in Lua? Lapis looks appealing otherwise but the lack of a built-in Unicode string type in L
by networked 12y ago
Is Unicode ever a problem when you do real-life web development in Lua? Lapis looks appealing otherwise but the lack of a built-in Unicode string type in Lua makes me somewhat wary.
- justincormack 12y agoThere are unicode libraries for Lua should you need to do unicode manipulation. In real life though I rarely have needed much. What functions do you need?
- networked 12y agoWhat I had in mind was Unicode string normalization, comparison and sorting as well as finding the length of strings correctly when they contain combining characters, ligatures and such. What is the library of choice for this? For anyone curious about the potential issues there is a good article about the flaws in JavaScript's handling of Unicode at http://mathiasbynens.be/notes/javascript-unicode#accounting-for-lookalikes http://mathiasbynens.be/notes/javascript-unicode#accounting-.... HN discussion: https://news.ycombinator.com/item?id=7221362 https://news.ycombinator.com/item?id=7221362.
- meric 12y agoYes, you'll need a unicode library for that. Lua's length operator count bytes not characters.
- plorkyeran 12y agoNot particularly. Lua doesn't do anything to make storing utf-8 in strings difficult. You have to bring your own Unicode library for doing anything nontrivial, but that's true of everything in Lua. Using ICU from Lua isn't substantially different from using it from any other lanugage.
- shanth 12y agoAnd they said, "Lua doesn't come with Batteries included"