gcc, UTF-8 and limits.h
Posted
by bobby
on Stack Overflow
See other posts from Stack Overflow
or by bobby
Published on 2010-04-18T18:14:26Z
Indexed on
2010/04/18
18:23 UTC
Read the original article
Hit count: 305
My OS is Debian, my default locale is UTF-8 and my compiler is gcc. By default CHAR_BIT in limits.h is 8 which is ok for ASCII because in ASCII 1 char = 8 bits. But since I am using UTF-8, chars can be up to 32 bits which contradicts the CHAR_BIT default value of 8.
If I modify CHAR_BIT to 32 in limits.h to better suit UTF-8, what do I have to do in order for this new value to come into effect ? I guess I have to recompile gcc ? Do I have to recompile the linux kernel ? What about the default installed Debian packages, will they work ?
© Stack Overflow or respective owner