[luatex] Off topic: A quiz

Paul Isambert zappathustra at free.fr
Thu Dec 12 10:59:37 CET 2013


De: "Patrick Gundlach" <patrick at gundla.ch>
> > space
> > not a space
> 
> that was the easy part... Now the question is "why"... (Its clear
> when you add anchors ^ and $ to the pattern).

I'll admit I don't get it. When I saw that

    unicode.utf8.match("à", "%s")

returned true, I thougt: "à" is "C3 A0" in UTF-8, but Lua knows about latin-1
only, and "A0" is the non-breaking space, hence the false positive. And then,
of course: but isn't unicode.utf8.match() supposed to know about UTF-8? What
good is it if it can't spot a multibyte character?

Then I tried

    string.match("à", "%s")

and it returned false, meaning actually the non-breaking space isn't
recognized by "%s", so my first explanation was wrong anyway.

I may be missing something here, being quite tired, but it seems to me
slnunicode is buggy or what?

Best,
Paul



More information about the luatex mailing list