Support for BOM encoded files

Hello

When creating markup (XML or HTML) files in Visual Studio they are created with UTF 8 BOM encoding (This file is created in VS 2017):

Markup files with UTF-8-BOM encoding is not supported by Enonic XP (With BOM XML files the application won’t start and BOM HTML breaks Content Manager).

If possible can you look into this and possible add support for UTF-8-BOM encoded files in Enonic XP?

1 Like

Hi

We have registered an issue to fix this.

You say that BOM encoding in HTML files break Content Studio. Is the page rendered correctly outside of CS?
Does it just fail while editing in Content Studio?

Breaking Content Studio was a lie. Do the following to replicate the issue:

Create a part view with (HTML) BOM encoding. Add the part to a page (everything is fine). Publish the page and reload, now you can’t select the part or see the part in the Components Panel (it is visible on the page (and stored)).

Are you certain it’s not the parent region code that is wrong?

Sometimes when I make a special page or layout I make mistakes and forget stuff that Content Studio depends on.
Look on a page that works. Notice how some html elements have special data attributes like data-portal-region=“main”.

Parts should have data-portal-component-type=“part”.

@aro Perhaps our postprocess doesn’t figure out where to apply data-portal-component-type=“part” when the encoding is BOM?

1 Like

@krelde I reproduced both issues: parsing the descriptor XMLs and rendering HTML parts that have the BOM character.

@Cwe You were right, the prostprocess fails to find the tag element to inject the data-portal attribute, when the BOM character is prefixing the HTML.

We will fix the issues in the next release.

2 Likes

This was fixed in 6.14.0 which was released on March 2nd!
Hope the solution works well.