lua-users home
lua-l archive

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

From: "Martin":

In description of string module maybe there should be explicitly noted
that string.byte string.char string.len (perhaps other functions too)
works intuitively only with ASCII encoding. With utf-8 encoding
that I have set on my computer results are strange. I do not know how
they work under Windows Unicode charset.

My manual states the above clearly:

"string.byte (s [, i [, j]])
Returns the internal numerical codes of the characters s[i], s[i+1], ···, s[j]. The default value for i is 1; the default value for j is i.

Note that numerical codes are not necessarily portable across platforms."

The same is said for string.char. Or do you mean to say string.char(string.byte('!')) does not work as expected?

I do agree about the fmod thing though, as the difference between "modulo" and "remainder" is not well defined.

- Alex