[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: is string.gmatch(), string.upper() 7-bit ascii only?
- From: koba@...
- Date: Thu, 7 Apr 2016 15:19:29 +0200
On Thu, Apr 07, 2016 at 03:00:32PM +0200, Marc Balmer wrote:
> I am trying to manipulate text with umlauts. string.upper() does not produce upper case version of umlauts like ä,ö,ü etc.
>
> Also the %g pattern, when used in string.gmatch() does not match these umlauts.
>
> Is there anything that can be done about it? Or, am I making a stupid mistake?
devel@katom:~$ lua
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> =os.setlocale()
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
> s="abòè"
> =s:match("%g+")
ab
> =s:upper()
ABòè
> =os.setlocale("it_IT")
it_IT
> return s:upper()
ABòè
> return s:match("%g+")
abòè
ciao,
I.