Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.0
-
None
-
None
-
None
Description
File orm.xml may contain JPQL or SQL queries with string literals with non-ASCII characters, e.g.
<named-native-query name="test">
<query>
select 'ћирилица'
</query>
</named-native-query>
Note the string literal with cyrillic letters.
If JVM variable file.encoding is set to something different (e.g. -Dfile.encoding=ISO-8859-1) from encoding of the file, specified in prolog of orm.xml (e.g. UTF-8), OpenJPA will respect file.encoding setting, which will demage string literals.
According to XML specification, OpenJPA should respect encoding as specified in prolog.
The problematic method seems to be: org.apache.openjpa.lib.meta.XMLMetaDataParser. parse(MetaDataIterator itr, boolean stopFirst), which opens InputStreamReader with default encoding from file.encoding variable.