Menu

#2 UTF-8 does not work with view type=document

open
nobody
None
5
2005-01-03
2005-01-03
No

When using

<view type="document" path="Imprint.xml" />

Where Imprint.xml is a status, UTF-8 encoded xml,
there are several errors:

-If the file contains a BOM, .NET complains about
bad data at the beginning of the file

-If the file does not contain a BOM, but Unicode-
encoded characters (=non ASCII characters), those
chars get scrambled. For example:

ÄÖÜäöü -> ÄÖÜäöü

I was not able to track the problem down to some
lines of code. Using a simple controller that gets
serialized, UTF-8 is correctly rendered. Maybe the
problem is the fact, that the document gets
executed. Anywhere there in the pipe, the encoding
gets scrambled.

Regards, Alexander Gräf

Discussion

  • Alexander Graef

    Alexander Graef - 2005-01-04

    Logged In: YES
    user_id=1030440

    The attached document is a workarround and allows
    simple physical loading of xml documents with correct
    encodings.

    You also need to insert this:

    Flow\Loader.cs:105
    IViewFactory xmlDocument = new
    XmlDocumentViewFactory();
    xmlDocument.Init(null, this.httpContext);
    masterFact.DefineViewFactory("xml-document",
    xmlDocument);

     
  • Alexander Graef

    Alexander Graef - 2005-01-04

    XmlDocumentView.cs

     
  • Alexander Graef

    Alexander Graef - 2005-01-04

    XmlDocumentViewFactory.cs

     

Log in to post a comment.

Auth0 Logo