Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316286 - String Character Encoding gets mixed up through .toLowerCase()
Summary: String Character Encoding gets mixed up through .toLowerCase()
Status: CLOSED INVALID
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-09 09:07 EDT by Matthias Vianden CLA
Modified: 2017-10-31 11:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Vianden CLA 2010-06-09 09:07:39 EDT
Build Identifier:  I20100527-1700

If you have an Xpand Script to replace characters, than the following statement will work correctly:
"צה�".replaceAll("ה","ae") ==> "צae�"
Whereas the following will not work:
"צה�".toLowerCase().replaceAll("ה", "ae") ==> "צה�"

See the following link for a more detailed discussion and a demo project (the discussion is in German!)
http://oaw-forum.itemis.de/forum/viewtopic.php?forum=1&showtopic=2213

Reproducible: Always

Steps to Reproduce:
See Dateils above and the demo project at: http://www.swc.rwth-aachen.de/DOCUMENTS/utf8test.zip
Comment 1 Karsten Thoms CLA 2012-11-29 15:50:08 EST
This is an encoding issue. The ResourceLoaderDefaultImpl#createReader() tries to detect the encoding by heuristics. While the XPT file is correctly identified as UTF-8, this fails for the EXT file, which is recognized as ISO-8859-1.

The input file encoding must be set through the ResourceManager, like follows:

	component = org.eclipse.xpand2.Generator {
		fileEncoding="UTF-8"
		metaModel = org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel {}
		expand = expand
		outlet = {
			path = targetDir
			fileEncoding="UTF-8"
			postprocessor = org.eclipse.xtend.typesystem.xsd.XMLBeautifier {
			}
		}
		resourceManager = org.eclipse.xtend.expression.ResourceManagerDefaultImpl {
		    fileEncoding = "UTF-8"
		}
	}


See also "Generator Workflow Configuration: Encoding" of Xpand manual.
Comment 2 Eclipse Webmaster CLA 2017-10-31 11:26:16 EDT
Requested via bug 522520.

-M.