Re: ctype_print returns false for British Pound symbol (and non-ASCII symbols)
| From: | Rasmus Lerdorf | Date: | Fri, 26 Feb 2010 21:36:47 +0000 |
| Subject: | Re: ctype_print returns false for British Pound symbol (and non-ASCII symbols) | ||
| References: | 1 2 3 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-1379@lists.php.net to get a copy of this message | ||
Bob wrote:
> Hello, Rasmus.
>
> Thank you for the excellent advice. I was trying to work out how to call
> the C-native version of ctype_print, and you managed to explain how to do
> so in very few bytes of text. (And led me to compile my first C program
> in Linux. Haven't used C for about fifteen years.)
>
> I get the exact same output as yourself:
>
> Ubuntu:~/ctype_print$ ./a £
> 0
> Ubuntu:~/ctype_print$ ./a $
> 16384
>
> So you're right. It's nothing to do with PHP.
>
> Which means that my question is now: how do I fix my locale? The £ is
> definitely in the locale definition file (under "print") for i18n, which
> is copied into the LC_CTYPE section by en_GB. So am I right in thinking
> that it should be a valid printable character when using that locale?
Like Norbert asked, which charset are you working in and does it match
your LOCALE?
-Rasmus