[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject ou
From: |
Tom Lane |
Subject: |
Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5? |
Date: |
Mon, 21 May 2012 11:06:52 -0400 |
Ken Hornstein <address@hidden> writes:
> My question back to you: do the is* functions take bytes, or
> characters? If they take bytes, then I agree with you. If they
> take characters ... well, I'm not sure what is right.
Quoting POSIX:2008, for isalnum and friends:
The c argument is an int, the value of which the application
shall ensure is a character representable as an unsigned char or
equal to the value of the macro EOF. If the argument has any
other value, the behavior is undefined.
So these functions only work portably in single-byte encodings.
Particular implementations might choose to make them do something useful
for input values above 255, but you couldn't expect that to work
everywhere. To work portably in UTF8 and other multi-byte encodings,
you have to go over to the wide-character functions in <wctype.h>.
regards, tom lane
- [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Ken Hornstein, 2012/05/20
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Tom Lane, 2012/05/20
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Ken Hornstein, 2012/05/20
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, paul vixie, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Tethys, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Ken Hornstein, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?,
Tom Lane <=
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Ken Hornstein, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Tom Lane, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Ken Hornstein, 2012/05/21
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, Tethys, 2012/05/23
- Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, valdis . kletnieks, 2012/05/24
Re: [Nmh-workers] A € for your thoughts - should we fix UTF-8 subject output in scan for 1.5?, paul vixie, 2012/05/21