Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET - Invalid character in the given encoding .resx

I am adding a number of languages to a client's website using the App_LocalResource folder containing .resx files.

The client's test application is hosted on a server with no outside Internet access so I have to remote desktop to the site and manually copy any changes made via Notepad..

So far, I have manually created an App_LocalResource folder, created the .resx files and copied the source of each file via Notepad.

I am now getting a parser error:

Parser Error Message: Invalid character in the given encoding.

Line 137:  </data>
Line 138:  <data name="DEATHINSERVICENOMINATIONS" xml:space="preserve">
Line 139:    <value>Mort à candidatures Prestation de service</value>
Line 140:  </data>
Line 141:  <data name="EDITPERSONALDATA" xml:space="preserve">

Would this possibly have something to do with me manually copying these files across using Notepad or is there another reason for it?

I have added this to the web.config file:

<globalization fileEncoding="utf-8"
    requestEncoding="utf-8"
    responseEncoding="utf-8"/>
like image 985
TGuimond Avatar asked Jul 16 '11 13:07

TGuimond


1 Answers

Try to add an encoding property in your resx file, at first line, like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
like image 183
Rubens Farias Avatar answered Nov 10 '22 14:11

Rubens Farias