View Single Post
  #8  
Unread 05-22-2013, 06:39 PM
Equendil Equendil is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Apr 2011
Posts: 52
Quote:
Originally Posted by Thurallor
You may notice the only escaping I'm doing for strings is replacing " with \" and \ with \\. I'm not sure if there's anything else I need to do, such as for strange foreign characters. Can anyone advise me?
'Foreign' characters are encoded into UTF8. While the lua interpreter does not handle that encoding, lua strings are nothing more than arbitrary sequences of bytes, and they are transmitted to and fro the game engine and file system without change, so you generally don't need to worry about it for storing/retrieving strings.

Full-proof code would probably require escaping line feeds and maybe other control characters though, as string literals within double quotes are supposed to be on one line.

Edit: I also don't understand the purpose of "text = string.gsub(text, ",$", "");"
__________________
Author of LIP, Bootstrap and Baruk

Last edited by Equendil : 05-22-2013 at 06:48 PM.
Reply With Quote