Hi, I've committed a version that has \luaescapestring. The (rather contrived) test file I used follows below. Cheers, taco % luaescapestring.tex \bgroup \catcode`B=1 \catcode`E=2 \catcode`.=0 .catcode`.\=12 .xdef .letterbackslash B.string\E .egroup {\tt \luaescapestring{"Hans' \relax-ed macro"}} \message{\luaescapestring{"Hans' \relax-ed macro"}} \lua {a="\letterbackslash n\luaescapestring{"Hans' \relax-ed macro"}"; print (a); } {\tt \luaescapestring{"}} \message{\luaescapestring{"}} \lua {a="\letterbackslash n\luaescapestring{"}"; print (a); } {\tt \luaescapestring{"Hans' \relax-ed macro"}} \message{\luaescapestring{"Hans' \relax-ed macro"}} \lua {a="\letterbackslash n\luaescapestring{\luaescapestring{"Hans' \relax}-ed macro"}"; print (a); } \bye