[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problems with: Most efficient way to recognize a line by its first three characters
- From: Tom N Harris <telliamed@...>
- Date: Wed, 12 Mar 2014 15:11:22 -0400
On Wednesday, March 12, 2014 07:49:22 PM meino.cramer@gmx.de wrote:
> Everything works fine...except the recongition of the lines
> beginning with '§'...
> And I have not a single idea, why...
That is not one "character". Or rather, UTF-8 encodes it as multiple bytes and
Lua only knows about bytes. So when you do `line:sub(1,3)` you're only going
to get '§7' without the last byte.
--
tom <telliamed@whoopdedo.org>