Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319823 - XMLBeautifier fails to process data with encoding different from platform-enc
Summary: XMLBeautifier fails to process data with encoding different from platform-enc
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 06:14 EDT by Ludwig Straub CLA
Modified: 2011-05-20 04:53 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: helios+


Attachments
XMLBeautifier.zip (1.98 KB, application/x-zip-compressed)
2010-07-14 06:15 EDT, Ludwig Straub CLA
no flags Details
Patch for set the file encoding before read and write (2.05 KB, patch)
2010-08-05 07:17 EDT, Benjamin Schwertfeger CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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