lua-users home
lua-l archive

Re: Backslash in strings

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Well, i gave the path example, but i use it in a regexp.
And in a regexp, it happens to be ,円 which i had to escape, if i was using "".
On 2005年3月18日 09:41:44 -0500, Brian Weed <bw@imaginengine.com> wrote:
> Groleo Marius wrote:
> 
> >Hi
> >
> >I'm passing a string from LUA to a c++ function.
> > The problem is that when I'm trying to pass something like:
> > "\Wabc\new\trial"
> > \W from \Wabc is regarded as an escaped character.
> > the same thing for \n from \new and \t from trial.
> > How can I pass the string to the c++ function, so the \W wont be
> > treated as an escape
> > character.
> >
> >
> FWIW, when I was faced with this problem for file paths, I changed all
> backslashes to the linux path seperator '/', which happens to also work
> for Windows.
> It's now a standard in our games that all path names use the linux slash
> (whether they are in a .lua file, or not).
> 
> Brian
> 
-- 
Regards, Groleo!
 .''`. # touch universe
: :' : # chmod +rwx universe
`. `'` # ./universe
 `- Debian - when you have better things to do than fix a system

AltStyle によって変換されたページ (->オリジナル) /