Last post Jul 09, 2008 03:26 AM by dadvir
Jul 17, 2007 11:52 AM|dadvir|LINK
i am working with visual studio for some time now and i have always looked for a solution for this problem:
how VS 2005 determines the file encoding when a new file is created?
my computer is Hebrew local and the default encoding for files is "Hebrew (Windows) - Codepage 1255".
i am developing web sites for the american market where the servers can't read the content of these files and the content goes wrong.
what i do is go over each and every file in the application, click File -> Advanced Save Options and there i change the encoding to "Unicode (UTF-8 with signature) - Codepage 65001"
i have tried to find and default value for this but came blank. i also tried to find the web for a solution but came out blank.
how can i specify a default value for the encoding of all files i create in a project under visual studio 2005?
howto file encoding vs visual studio 2005 question
Jul 17, 2007 03:31 PM|aramka|LINK
Maybe this section of the web.config might help:
You may find more info here:
Jul 18, 2007 01:00 AM|dadvir|LINK
thanks for your reply.
i have added the mentioned lines of configuration to the web.config file and it didn't work.
the problem is that the files themselves are saved in encoding that is not supported by the designated web server. i have managed to solve this.
me question is how to set the default file encoding when i am creating new file in a web project (or at all in VS 2005)?
Jul 19, 2007 11:49 PM|Benson Yu - MSFT|LINK
I also tried to find the way to set default encoding to Unicode. However, I haven’t found it. When we change the encoding for a file by “Advanced Save Options”, we can notice that the file be changed immediately. For example, after we change the encoding
for “test.aspx”, the file name become “test.aspx*”. It means the file has been changed. You can view the difference between them by Hex editor. Hence, the encoding information is saving in the file, not otherwhere.
Based on my research, there are two workarounds to fix this issue:
1. The default file encoding of Visual Studio depends on the Windows setting. Following is the location that you can change it.
Control Panel | Regional and Language Options | Advanced | change the language to English from the drop down list.
2. Since the files we add in project are from the templates, we can change the encoding for those templates.
Visual Studio 2005 installed folder\Common7\IDE\ItemTemplates
Jul 09, 2008 03:00 AM|sculptor|LINK
Ok but i couldnt change the settings in the server,
what to do then,
coz the application working pretty fine in my PC but when i upload it to web hosting it goes wrong I've tried to change the encoding it worked particularly but there are some elements still can not be read.
i have added the globalization property in web config but still not working.
i also when i want to save data through insert query from the application it is saved like "???????????" .
but when i read from the database its readable and every thing is ok if the data inserted from myLittileAdminTool
Jul 09, 2008 03:26 AM|dadvir|LINK
You cannot change the settings of the files on the server machine nor the dev machine...
The only option you have is re-saving the files with the proper encoding! Visula studio suuports that using the command File -> "Advanced Save Options" in 2008 or maybe somthing similar in older versions of VS.