Details
Description
While using special characters (german ß,ä,ö,ü,Ä,Ö,Ü) in the apps messages_de.properties everything looks good.
But the same messages_de.properties within a in-place-plugin or an external plugin (eg nimble) results in strange characters.
Sitenote:
I also noted something strange about the properties files generated by grails create-app:
While "messages_da.properties" is ISO-8859-1 encoded the other "messages_XX.properties" are UTF-8 encoded. I think this should be more consistent.
- messages_nl.properties / messages_zh_CN.properties / messages.properties are pure ascii so
- messages_pt_PT.properties is UTF-8 but has an error sign in the commented line
—
-
Hide
- grails-6813.zip
- 01/Sep/11 9:14 AM
- 195 kB
- Lucas Teixeira
-
- grails-6813/app/.classpath 0.7 kB
- grails-6813/app/.project 0.5 kB
- grails-6813/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- grails-6813/app/application.properties 0.2 kB
- grails-6813/app/.../conf/BootStrap.groovy 0.1 kB
- grails-6813/app/.../conf/BuildConfig.groovy 1 kB
- grails-6813/app/.../conf/Config.groovy 4 kB
- grails-6813/app/.../conf/DataSource.groovy 0.8 kB
- grails-6813/app/.../spring/resources.groovy 0.0 kB
- grails-6813/app/.../conf/UrlMappings.groovy 0.2 kB
- grails-6813/app/.../i18n/messages.properties 3 kB
- grails-6813/app/.../messages_da.properties 3 kB
- grails-6813/app/.../messages_de.properties 4 kB
- grails-6813/app/.../messages_es.properties 3 kB
- grails-6813/app/.../messages_fr.properties 2 kB
- grails-6813/app/.../messages_it.properties 2 kB
- grails-6813/app/.../messages_ja.properties 2 kB
- grails-6813/app/.../messages_nl.properties 3 kB
- grails-6813/.../messages_pt_BR.properties 3 kB
- grails-6813/.../messages_pt_PT.properties 3 kB
- grails-6813/app/.../messages_ru.properties 4 kB
- grails-6813/app/.../messages_th.properties 5 kB
- grails-6813/.../messages_zh_CN.properties 2 kB
- grails-6813/app/.../views/error.gsp 2 kB
- grails-6813/app/.../views/index.gsp 0.2 kB
- grails-6813/app/.../layouts/main.gsp 0.8 kB
- grails-6813/app/web-app/css/main.css 5 kB
- grails-6813/app/.../images/favicon.ico 10 kB
- grails-6813/app/.../images/grails_logo.jpg 8 kB
- grails-6813/app/.../images/grails_logo.png 10 kB
-
- grails-6813.png
- 26 kB
- 01/Sep/11 9:14 AM
Issue Links
- is duplicated by
-
GRAILS-7114
Inconsistent behaviour on handling message.properties located in in-place-plugins
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
I just experienced that the behavior seems to be different between 'grails run-app' AND 'grails-run-war'
while 'grails run-app' expects the message.properties - file in the main projekt as utf-8, it expects it in in-place-plugins SO-8859-1 encoded
grails run-war shows a different behavior: It needs all the message.properties to be utf-8 encoded, to be able to display special characters correctly in the pages.
native2ascii gets called for i18n properties files when the war file is built.
I think we might have to set defaultEncoding somewhere here
Hi guys,
Just to tell this is happening in PT_BR lang too.
When the messages_pt_BR.properties is inside the applications, messages with accented chars (á,é,í,ó,ú) shows fine, but, after moving the properties files to one plugin, the accented chars shows as strange chars.
Thanks,
Hi,
I've attached one zip with two folders. One 'app' folder and one 'msgs' folder.
The 'msgs' is a plugin added in the 'app' application as an in-place plugin:
grails.plugin.location.msgs = "../msgs"
The application message.properties file has one line as this:
sample.message.inside.application = há hé ça ço
And the plugin, a equals line, but just with another key:
sample.message.inside.plugin = há hé ça ço
The app index.gsp (http://localhost:8080/app) is reading both propeties:
<p>App message: <g:message code="sample.message.inside.application" /></p> <p>Plugin message: <g:message code="sample.message.inside.plugin" /></p>
And the output is being different for both:
App message: há hé ça ço Plugin message: há hé ça ço
There is an screenshot of this output attached.
Thanks,
Our application don't use in-place plugins, but builded and packaged ones, happens the same way.
If you need some example of the same behaviour using a packaged plugin, just tell me and i'll attach.
Thanks,
Hi,
Is there another workaround? Other than changing the encoding of the message.properties in the plugin?
Thanks
This has also happened to me with properties defined for Spanish, such as á,é,í,ó,ú or ñ, which are rendered as �.
I have these properties defined in an external plugin, but it also happens when I have Spanish properties defined in the default messages.properties in my Grails application.
So sad. Being pushed ahead since Grails 1.3.6. More than 2 years...
Workaround: copying files from plugins to apps each build.
Pushed ahead? it has been brought forward, it was scheduled for 2.3 and I changed it to be scheduled for 2.1.5 and 2.2.1
Sry about that Graeme, just used to follow this issue being pushed.
Great to hear this. Thank you! ![]()
Lucas
Workaround:
If the german message_de.properties file is ISO-8859-1 encoded in the in-place-plugin the special chars are shown correctly.
nevertheless a consistent behavior and file encoding is needed.