[GeoNetwork-devel] [GeoNetwork opensource Developer website] #980: ExtJs apps lang files are compressed with wrong encoding

#980: ExtJs apps lang files are compressed with wrong encoding
----------------------------------+-----------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: Future release
Component: User interface (web) | Version: v2.6.5
Keywords: encoding |
----------------------------------+-----------------------------------------
In the context of building geosource from trunk, the App-mini.js generated
file ends up with all utf-8 chars from web-
client/src/main/resources/apps/js/OpenLayers/lib/OpenLayers/Lang/fr.js
(and probably other langs) are replaced by '?' in the temporary
./target/classes/apps/js/GeoNetwork/lib/GeoNetwork/lang/fr.js file, and in
the yui-compressed App-mini.js file.

So all translations strings coming from extjs look broken, they end up in
the ui as ??, so for example on geosource homepage i get 'crit??res
avanc??es' instead of 'critères avancés'.

The easy fix i've found is to force yuicompressor-maven-plugin to use
utf-8 encoding :

Index: web-client/pom.xml

--- web-client/pom.xml (revision 9207)
+++ web-client/pom.xml (working copy)
@@ -78,6 +78,7 @@
            <nosuffix>true</nosuffix>
            <gzip>false</gzip>
            <force>true</force>
+ <encoding>${project.build.sourceEncoding}</encoding>
            <nomunge>true</nomunge>
            <jswarn>${minify.verbose}</jswarn>
            <excludes>

By default it seems yuicompressor is supposed to be in utf-8, but in my
environment it was not the case.

Note that i havent checked, but it seems only geosource/pom.xml defines
project.build.sourceEncoding, so it 'might' break geonetwork. We can
aswell hardcode utf-8 here, since all the lang files are in utf-8...

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/980&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#980: ExtJs apps lang files are compressed with wrong encoding
----------------------------------+-----------------------------------------
Reporter: landry | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: Future release
Component: User interface (web) | Version: v2.6.5
Keywords: encoding |
----------------------------------+-----------------------------------------

Comment(by landry):

After a bit more digging... this is equivalent to passing
-Dfile.encoding=UTF-8 to maven, and fixes the issue for me. Otherwise, all
accentued/utf chars are replaced by ? in the generated .js.

ie for example in gn.libs.map.js
GeoNetwork.lang.fr={featureInfoTooltipTitle:"caract??ristique"
vs
GeoNetwork.lang.fr={featureInfoTooltipTitle:"caract<C3><A9>ristique" (utf-
display in vim, this one is correctly displayed in the browser)

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/980#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#980: ExtJs apps lang files are compressed with wrong encoding
-----------------------------------+----------------------------------------
  Reporter: landry | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: Future release
Component: User interface (web) | Version: v2.6.5
Resolution: fixed | Keywords: encoding
-----------------------------------+----------------------------------------
Changes (by jesseeichar):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/980#comment:2&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#980: ExtJs apps lang files are compressed with wrong encoding
-----------------------------------+----------------------------------------
  Reporter: landry | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: v2.8.0 RC2
Component: User interface (web) | Version: v2.8.0RC1
Resolution: fixed | Keywords: encoding
-----------------------------------+----------------------------------------
Changes (by landry):

  * version: v2.6.5 => v2.8.0RC1
  * milestone: Future release => v2.8.0 RC2

Comment:

https://github.com/geonetwork/core-
geonetwork/commit/9c88deb7e6c01546b28ac04464ac4400e3d0cec1

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/980#comment:3&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.