lua-users home
lua-l archive

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


> 2. The Lua string library is byte-oriented. I can search for five-letter
>    proper names with "%u%l%l%l%l" and find "Emile" but not "Émile".

It depends on the locale:

s=[[
2. The Lua string library is byte-oriented. I can search for five-letter
   proper names with "%u%l%l%l%l" and find "Emile" but not "Émile".
]]
print("locale",os.setlocale())
for w in s:gmatch("%u%l%l%l%l") do print(w) end
os.setlocale"en_US.ISO8859-1" -- Mac OS X name
print("locale",os.setlocale())
for w in s:gmatch("%u%l%l%l%l") do print(w) end