Quote:
Originally Posted by gda
In particular for Slackware the default encoding is ISO-8859-2 and so I suppose this encoding is used.
|
No, nowadays the default encoding is UTF-8:
Quote:
# en_US.UTF-8 is the Slackware default locale.
and some lines further
export LANG=en_US.UTF-8
# 'C' is the old Slackware (and UNIX) default, which is 127-bit ASCII
# with a charmap setting of ANSI_X3.4-1968.
#export LANG=C
|
(from the file /etc/profile.d/lang.sh.new, out of the etc- package).
Note that the 2nd "export" is commented out (as are all other options).
If your system has ISO-8859-2 as a default, you did that yourself, maybe when you installed your system.
Then the "str*" functions are not magical or so: when iso-8859 characters go into them, you will get iso-8859 chars printed, INdependant of your locale.
So to get utf-8 ones: IN an editor with the utf-8 locale, create the characters in the
"strcat(test,"øèéö");"
line, so that those chars are utf-8 (that is: multibyte) and not iso-8859 (which is a single byte character set, it only has 256 values to display, that is why there are multiple iso-8859-* standards).utf-8 has characters that can be UP to 4 bytes, so it can display many more characters, but it does mean the same code(s) mean different things, as values 128 through 255 are used differently in iso-8859 from utf-8
See for more info
man iso-8859-2 or
man utf-8