1
Vote

Codepage validation on file save

description

I have xml-flie with such structure for my app update metadata on server:
<?xml version="1.0" encoding="windows-1251"?>
<body>
  <NameFUpdater>Update_TO_Global.exe</NameFUpdater>
  <date>25.11.2015 12:30</date>
  <InstallParams>/p=</InstallParams>
  <IsTOUpdate>2</IsTOUpdate>
  <MovePrivateVersion>0</MovePrivateVersion>
</body>
As you notice, this file has custom encoding specification (<?xml version="1.0" encoding="windows-1251"?>), but xml notepad doesn't check on exit that this file contains simbols with different codepage (e.g. Unicode), which causes bugs on my server.
Can you add encoding validation?

You can check this bug, for example, by copying date from some external source and inserting it in this file opened in xml notepad.

P.S. xml-file system encoding is correct - non unicode!

I attached erroneous xml-file with incorrect encoding symbols in tag <date>.

file attachments

comments