How does one instruct Lua(La)TeX -- specifically, the lua code invoked via a \directlua directive -- to insert a non-ASCII unicode symbol, such as a "zero width non-joiner" symbol (code U+200C), into the text stream? I already know how to do this inside the body of a (Lua)LaTeX document -- I'd type something like
stuff\char"200C{}morestuff
But how does one do this from inside lua code?
Addendum to (hopefully...) clarify what I'm trying to get done. If there's a string in the input stream such as xyz123, I'd like to insert a specific character (this evil invisible ZWNJ character...) between xyz and 123, so that the input stream now is
xyz<ZWNJ>123
I already have the code to (i) find all instances of xyz123 in the input stream and (ii) find the insertion point for the ZWNJ character inside the string xyz123. What I'm stuck with is trying to figure out how to insert the ZWNJ character (a "node" in luatex speak? of what type?) at the insertion location.
stuff\char"200C morestuff, without the empty group. The space is ignored because it follows a required constant. Or also^^^^200cwhich is even better, because it's converted to the "real character" during tokenization. Since Lua code in\directluais tokenized on the TeX side, it's possible that^^^^200cworks. – egreg Sep 04 '13 at 21:46\directlua{ require("myfile.lua") }. :-( – Mico Sep 04 '13 at 21:56