Developer forum

Forum » CMS - Standard features » Itemtype xml file encoding

Itemtype xml file encoding

Lars Larsen
Lars Larsen
Reply

Hi

When Dynamicweb saves an itemtype to the filesystem as an XML file it saves it as an UTF-8 encoded file. But in the mark up it says "UTF-16":

<?xml version="1.0" encoding="utf-16" standalone="yes"?>

Isn't this a bug? Wouldn't it make sense to change the markup to reflect the encoding the file is saved in?

It has the consequence that when you make a change to an itemtype XML document within Visual Studio and saves the file VS saves the file with UNICODE encoding. Now Git sees the file as a binary file which makes it difficult to compare the previous and current version of the file. 


Replies

 
Nicolai Pedersen
Reply

Maybe... I never had any issues with this.

The string writer that is used by the XML serializer is in utf16 by default I think - I do not know if switching file encoding to utf16 or xml to utf8 would cause issues with compatibility.

Any others in here have any issues with the format?

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I had issues in the past when editing XML files. Mostly with editing Job xml's.

But I am not sure if the above issue was the cause for it.

Adrian

 

 

 
Lars Larsen
Lars Larsen
Reply

Hi

I fixed the issue by adding an ".editorconfig" to the folder "/Files/System/Items". I have configured the file to ensure that the xml documents within the folder are always saved in UTF-8 when edited with VS.

But I think it's odd that DW saves the itemtype xml documents with UTF-8 encoding and still in the first line of the xml documents it says "encoding='utf-16'" !!

 

You must be logged in to post in the forum