config file ok without encoding?

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.
 
N

Nick Malik

sounds like you've solved your problem. Simply deliver the config file with
the encoding tag set to ANSI from now on.

--- Nick
 
L

Luc E. Mistiaen

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
 
P

Paul Wardle

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top