|
Posted by Kimmo Laine on 03/08/06 15:44
Hello group
I'm hoping someone could explain to me what is happening with MSSQL and
character encoding. First of all the thing is that the data I'm using has a
few special scandinavian characters: a with ring, a with dots, o with dots,
plus the euro currency symbol. Now, when I pull the data from MSSQL database
in normal webpage, the characters are encoded in ISO-8859-1 (Latin 1). But
when I run the same php script from the command line, suddenly the data from
the database is encoded like MS-DOS Codepage 850. This messes up the
scandinavic characters and I need to convert them back like so:
$line = str_replace(
array(chr(143),chr(142),chr(153),chr(134),chr(132),chr(148),chr(95)),
array(chr(197),chr(196),chr(214),chr(229),chr(228),chr(246),chr(128)),
$line
);
I'm looking for a solution that would not require me to replace single
characters one-by-one, but would change the character encoding mssql uses
for the data. And also an explanation of why this is happening. Any kind of
help will be appreciated.
PS. Using Win2003 Server, IIS6, PHP 5.0.5
Cheers
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|