[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: character encoding confusion
From: |
patrol |
Subject: |
Re: character encoding confusion |
Date: |
Wed, 08 Dec 2010 15:17:49 -0000 |
User-agent: |
G2/1.0 |
On Jul 7, 6:37 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
>
> Remember that C only deals with integer. There is no character type in C.
I thought there was a char data type. Well, not exactly sure the
relevence of that...
> So, what happens when you call: printf("%c",176); ?
Well as I said in my post, I get a shaded square. But printf("%c",
248) yields the degree sign. But like I said, under Latin-1 and UTF-8,
176 is the degree sign, not 248.
> Have a look at setlocale, LC_ALL, etc, and libiconv.
I don't have any experience with this, but I did printf("%d", LC_ALL),
which returned 0. Don't know what that means, but I'm not sure why
locale settings should matter. Aren't Latin-1 and UTF-8 universal
encodings? If a file is encoded in Latin-1, wouldn't the degree sign
map to 176 regardless of locale?