config file ok without encoding?

  • Thread starter Thread starter Bill Ray
  • Start date Start date
B

Bill Ray

The company I work for has several vb.net windows apps. Our config
files all start with
<?xml version="1.0" encoding="Windows-1252"?>
We have trouble if we edit the config file in notepad and save. We
found out a work around. In notepad, if we change the default encoding
from UTF to ANSI, then our apps run fine, otherwise they bomb when
loading the config file. But this sucks because users and support
people forget to do this.

I just found another fix, but I was wondering if someone can explain
to me what functionality I maybe loosing by changing our config file
to start like this
<?xml version="1.0"?>
taking out the encoding.
 
sounds like you've solved your problem. Simply deliver the config file with
the encoding tag set to ANSI from now on.

--- Nick
 
The default encoding for XML is UTF-8. That's what is assumed when you don't
specify it in the file and that must match the actual content of the file
for it to be parsed properly.

/LM
 
Have you tried using unicode encoding?

Notepad writes a marker FF FE at the start of a unicode text file, and
detects that its unicode when its opened.

These markers are also recognised by the XML classes in .NET - so if you use
a unicode encoding all should be OK?

Any help?

Paul Wardle
 
Back
Top