[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: how to handle \026 character in a string
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Fri, 22 Oct 2010 10:57:46 +0200
2010/10/22 Baranov, Paul UTCFS <Paul.Baranov@fs.utc.com>:
> My lua code needs to deal with strings that contain \026 characters in
> them. There are no problems if these characters get escaped. But if they
> are used as is lua doesn't want to load the script and spits off an
> error "unfinished string near '<eof>' It does report this error even if
> line with such string is commented out. If this a Lua bug and if not is
> there any work around beside use of an escape sequence.
> Below is an example of such string:
> "5-3 Test Output >1: ult RAS Ar 2: Default RAS Back Address"
loadfile and dofile seem to ignore whatever appears after the
character. However you can read the file with file:read, and then pass
the content to loadstring which parses it fine.