Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swedish text in Web.config

If I have a setting of

<add key="emailSubject" value="Få en snabb start på ditt rökfria liv!" />

in a custom section within my web.config. Naturally it works fine on my local machine.

On our server however I get:

Parser Error Message: Invalid character in the given encoding.

If I change the value to use HTML equivalents for umlauts and circles over the 'a's then I get

Failed to load resource: the server responded with a status of 500 (The type initializer for '....Sweden.ApplicationConfiguration' threw an exception.)

Would anyone have any ideas on how to use umlauts and the like as config values?

If the worst comes to the worst I could hard code it but I'd prefer not to.

like image 277
Mark Holland Avatar asked Dec 29 '10 14:12

Mark Holland


1 Answers

Saving as UTF-8 format should help. (BTW and possibly off-topic: I still love Joel's article about Unicode from 2003).

like image 78
Uwe Keim Avatar answered Nov 10 '22 02:11

Uwe Keim