Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319823

Summary: XMLBeautifier fails to process data with encoding different from platform-enc
Product: [Modeling] M2T Reporter: Ludwig Straub <shadowrobe>
Component: XpandAssignee: Project Inbox <m2t.xpand-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: darius.jockel, sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: helios+
Target Milestone: SR1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
XMLBeautifier.zip
none
Patch for set the file encoding before read and write sven.efftinge: iplog+

Description Ludwig Straub CLA 2010-07-14 06:14:33 EDT
Build Identifier: 20100617-1415

If the input data for the class org.eclipse.xtend.typesystem.xsd.XMLBeautifier in a standalone-workflow does not match the encoding of the workspace (platform encoding?), the input cannot be processed properly.

Example:
- Workspace-enc: Cp1252
- Data-enc: UTF-8
=> Beautifier aborts with encoding-error

Reproducible: Always

Steps to Reproduce:
1. Set workspace-encoding to encoding that is not UTF-8
2. Tell Xpand to generate UTF-8 code
3. Run workflow with beautifier
Result: Beautifier aborts with encoding-error

Attached you will find a patched version of the XMLBeautifier class with this problem fixed.
Comment 1 Ludwig Straub CLA 2010-07-14 06:15:01 EDT
Created attachment 174275 [details]
XMLBeautifier.zip
Comment 2 Benjamin Schwertfeger CLA 2010-08-05 07:17:32 EDT
Created attachment 175921 [details]
Patch for set the file encoding before read and write

The file encoding should be determined before reading the file and set to the output for writing the beautified file.
Comment 3 Sebastian Zarnekow CLA 2010-08-05 07:37:18 EDT
Patch looks good to me although tests are missing.
Comment 4 Darius Jockel CLA 2010-08-24 15:56:13 EDT
Patch applied