A
AmigoFd
Hello,
This problem is really driving me crazy ...
* I have a mySql database which is latin1_swedish_ci
* In my web.config I have:
<globalization requestEncoding="ISO-8859-2"
responseEncoding="ISO-8859-2" fileEncoding="iso-8859-2" culture="pl-PL"
uiCulture="pl-PL" />
* My page has: <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-2" />
* And when I insert text in the database I have a replace like this:
private static string CodeAccents(string doReCode) {
string rt = doReCode;
// dutch
rt = rt.Replace("ê","ê");
rt = rt.Replace("Ê","Ê");
rt = rt.Replace("ë","ë");
rt = rt.Replace("Ë","Ë");
// french
rt = rt.Replace("é","é");
rt = rt.Replace("É","É");
rt = rt.Replace("è","è");
rt = rt.Replace("È","È");
rt = rt.Replace("ê","ê");
rt = rt.Replace("Ê","Ê");
rt = rt.Replace("á","á");
rt = rt.Replace("Á","Á");
rt = rt.Replace("à","à");
rt = rt.Replace("À","À");
rt = rt.Replace("ä","ä");
rt = rt.Replace("Ä","Ä");
// polish
rt = rt.Replace("A","Ą");
rt = rt.Replace("a","ą");
rt = rt.Replace("C","Ć");
rt = rt.Replace("c","ć");
rt = rt.Replace("E","Ę");
rt = rt.Replace("e","ę");
rt = rt.Replace("L","Ł");
rt = rt.Replace("l","ł");
rt = rt.Replace("N","Ń");
rt = rt.Replace("n","ń");
rt = rt.Replace("Ó","Ó");
rt = rt.Replace("ó","ó");
rt = rt.Replace("S","Ś");
rt = rt.Replace("s","ś");
rt = rt.Replace("Z","Ź");
rt = rt.Replace("z","ź");
rt = rt.Replace("Z","Ż");
rt = rt.Replace("z","ż");
return rt;
}
Now, when I for instance save this word: "Zdjecia"
And I return to the form it is saved like "Zdj & # 2 8 1 cia" (spaces
added for posting here)
But when I then save again and retur I get this: "Zdjecia" = "# 3 7
7 dje & # 2 6 3 i & # 2 6 1" (spaces added for posting here)
What am I doing wrong ???
Thanks !
This problem is really driving me crazy ...
* I have a mySql database which is latin1_swedish_ci
* In my web.config I have:
<globalization requestEncoding="ISO-8859-2"
responseEncoding="ISO-8859-2" fileEncoding="iso-8859-2" culture="pl-PL"
uiCulture="pl-PL" />
* My page has: <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-2" />
* And when I insert text in the database I have a replace like this:
private static string CodeAccents(string doReCode) {
string rt = doReCode;
// dutch
rt = rt.Replace("ê","ê");
rt = rt.Replace("Ê","Ê");
rt = rt.Replace("ë","ë");
rt = rt.Replace("Ë","Ë");
// french
rt = rt.Replace("é","é");
rt = rt.Replace("É","É");
rt = rt.Replace("è","è");
rt = rt.Replace("È","È");
rt = rt.Replace("ê","ê");
rt = rt.Replace("Ê","Ê");
rt = rt.Replace("á","á");
rt = rt.Replace("Á","Á");
rt = rt.Replace("à","à");
rt = rt.Replace("À","À");
rt = rt.Replace("ä","ä");
rt = rt.Replace("Ä","Ä");
// polish
rt = rt.Replace("A","Ą");
rt = rt.Replace("a","ą");
rt = rt.Replace("C","Ć");
rt = rt.Replace("c","ć");
rt = rt.Replace("E","Ę");
rt = rt.Replace("e","ę");
rt = rt.Replace("L","Ł");
rt = rt.Replace("l","ł");
rt = rt.Replace("N","Ń");
rt = rt.Replace("n","ń");
rt = rt.Replace("Ó","Ó");
rt = rt.Replace("ó","ó");
rt = rt.Replace("S","Ś");
rt = rt.Replace("s","ś");
rt = rt.Replace("Z","Ź");
rt = rt.Replace("z","ź");
rt = rt.Replace("Z","Ż");
rt = rt.Replace("z","ż");
return rt;
}
Now, when I for instance save this word: "Zdjecia"
And I return to the form it is saved like "Zdj & # 2 8 1 cia" (spaces
added for posting here)
But when I then save again and retur I get this: "Zdjecia" = "# 3 7
7 dje & # 2 6 3 i & # 2 6 1" (spaces added for posting here)
What am I doing wrong ???
Thanks !