Since I moved our Intranet to a new Server (Windows Server 2008 / IIS 7) I have a problem: instead of special characters such as à, è, ì, ò, ù, €... reversed question marks are stored in the database.
I have the same problem both in ASP.NET and PHP applications.
WHAT I ALREADY TRIED:
- edit the web.config file in the root directory of the Intranet, adding .php and .aspx extensions;
- change the charset in the web.config file of my .NET applications;
- change the charset in the php.ini file;
- change the charset within IIS (.NET Globalization section).
Please notice that with the old Server (Window Server 2003 / IIS 6) everything worked fine. And please notice that client-server applications work fine even now, so it's definitely a web applications problem only.
Any help would be appreciated, as I'm totally stuck!
Thank you
Then I restarted IIS, but unfortunately it didn't work.
Please notice that globalization in the web.config files of my .NET projects were already set as UTF-8.
I have the same problem in my PHP applications anyway, so I guess there is something wrong with the web server.
I've run out of ideas.
Do you have any other suggestions?
Thank you very much
Machine.config configuration on server over writes your web applications(PHP, ASP.NET)
web.config files.
What are your encoding configuration in individual Web.config files in each application?
<globalization requestEncoding="utf-8" responseEncoding="utf-8" <br>
culture="nl-NL" />
//Encoding is done through the attributes requestEncoding and //responseEncoding. The values should be equal in all one-server //environments. In this example, the application culture is set to Dutch.
//If you don’t supply a culture, the application will use the server’s regional //settings.
http://www.sitepoint.com/web-config-file-demystified/
Note that .NET framework by default supports UTF-16 encoding.
aletheia2
Member
49 Points
58 Posts
Big problem with charset
Sep 16, 2011 09:30 AM|LINK
Hi people,
Since I moved our Intranet to a new Server (Windows Server 2008 / IIS 7) I have a problem: instead of special characters such as à, è, ì, ò, ù, €... reversed question marks are stored in the database.
I have the same problem both in ASP.NET and PHP applications.
WHAT I ALREADY TRIED:
- edit the web.config file in the root directory of the Intranet, adding .php and .aspx extensions;
- change the charset in the web.config file of my .NET applications;
- change the charset in the php.ini file;
- change the charset within IIS (.NET Globalization section).
Please notice that with the old Server (Window Server 2003 / IIS 6) everything worked fine. And please notice that client-server applications work fine even now, so it's definitely a web applications problem only.
Any help would be appreciated, as I'm totally stuck!
Thank you
sukumarraju
All-Star
16951 Points
2999 Posts
Re: Big problem with charset
Sep 16, 2011 09:54 AM|LINK
Is the machine.config file updated on web server?
http://serverfault.com/questions/80895/how-do-i-change-the-default-character-encoding-in-iis-on-windows-server-2003
Application Architecture Guide 2.0
My Blog
Twitter
aletheia2
Member
49 Points
58 Posts
Re: Big problem with charset
Sep 16, 2011 10:08 AM|LINK
Dear Sukumarraju,
I opened the machine.config file, and I changed the following code:
<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
with:
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
Then I restarted IIS, but unfortunately it didn't work.
Please notice that globalization in the web.config files of my .NET projects were already set as UTF-8.
I have the same problem in my PHP applications anyway, so I guess there is something wrong with the web server.
I've run out of ideas.
Do you have any other suggestions?
Thank you very much
sukumarraju
All-Star
16951 Points
2999 Posts
Re: Big problem with charset
Sep 16, 2011 12:05 PM|LINK
Machine.config configuration on server over writes your web applications(PHP, ASP.NET) web.config files.
What are your encoding configuration in individual Web.config files in each application?
<globalization requestEncoding="utf-8" responseEncoding="utf-8" <br> culture="nl-NL" /> //Encoding is done through the attributes requestEncoding and //responseEncoding. The values should be equal in all one-server //environments. In this example, the application culture is set to Dutch. //If you don’t supply a culture, the application will use the server’s regional //settings. http://www.sitepoint.com/web-config-file-demystified/Note that .NET framework by default supports UTF-16 encoding.
Application Architecture Guide 2.0
My Blog
Twitter
aletheia2
Member
49 Points
58 Posts
Re: Big problem with charset
Sep 19, 2011 07:14 AM|LINK
I didn't know that, thanks for teaching.
In all my individual web.config files I have this code:
<globalization
culture="it-IT"
uiCulture="it-IT"
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
Actually I'm still using Framework 1.1. This might be a problem?
Thank you very much
aletheia2
Member
49 Points
58 Posts
Re: Big problem with charset
Sep 27, 2011 10:37 AM|LINK
Somebody could please let me know if there is an official technical support for IIS about these kinds of matters?
I've been searching on the web for a solution for a long time, but I'm still stucked.
Thank you very much...
sukumarraju
All-Star
16951 Points
2999 Posts
Re: Big problem with charset
Sep 27, 2011 10:45 AM|LINK
http://forums.iis.net/
Application Architecture Guide 2.0
My Blog
Twitter
aletheia2
Member
49 Points
58 Posts
Re: Big problem with charset
Sep 27, 2011 12:00 PM|LINK
Thank you
leena.d.pati...
Member
430 Points
79 Posts
Re: Big problem with charset
Oct 17, 2011 01:16 PM|LINK
Check whether you have mention correct datatype while storing values to the database. for unicode values data type has to be nchar/nvarchar/ntext.
Leena
Please remember to mark replies as answers if you find them useful.