Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Lite UI 1.5.0: accented characters displayed as "?"

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Lite UI 1.5.0: accented characters displayed as "?"


Chronological Thread 
  • From: Dominique Petitpierre <>
  • To: "GW Brown, Information Systems and Computing" <>
  • Cc: Chris Hyzer <>,
  • Subject: Re: [grouper-users] Lite UI 1.5.0: accented characters displayed as "?"
  • Date: Wed, 10 Feb 2010 12:57:38 +0100
  • Organization: University of Geneva

Hello,

Thanks for your message:

On 05.02.2010 16:22, GW Brown, Information Systems and Computing wrote:

> I've tried replicating the problem. At first I added utf8 accented
> characters in group names - and they appeared OK. I tried altering a
> couple of labels in nav.properties - one each for the two UIs, and
> they also worked.
>
> I then checked the encoding for nav.propeties and it came up as Ansi
> (Notepad++). I switched it to utf8 (and had to fix the accented
> characters) and restarted the webapp. Now, somewhat bizarrely, I get
> problems. I did a quick Google on ResourceBundles and UTF8 and
> apparently this is a known problem:
> <http://www.thoughtsabout.net/blog/archives/000044.html>.

Interesting!

> Dominique: what encoding have you got for your nav.properties file?

ISO-8859-1 is used (Latin-1).

As mentioned in my previous reply, the problem was not just in
nav.properties but also with data from the Grouper DB or the source
directory, displayed on the browser or exported in a CSV file.



As for the java default encoding problem (cf my previous message) here
are some more details. One can reproduce it on Unix like this:

# Add some accented characters in nav.properties (e-acute ISO-8859-1
# encoded, octal code 351):

grep connexion resources/grouper/nav.properties | cat -v
logout=DM-iconnexion
simpleMembershipUpdate.logoutText=DM-iconnexion

grep connexion resources/grouper/nav.properties | od -c
0000000 l o g o u t = D 351 c o n n e x i
0000020 o n \n s i m p l e M e m b e r s
0000040 h i p U p d a t e . l o g o u t
0000060 T e x t = D 351 c o n n e x i o n
0000100 \n
0000101

# Recreate the war file explicitly setting the locale to "C" (ASCII)
# (which is the default in my Unix environment)
env LANG=C ant clean war
# The resulting nav.properties has the accented characters converted
# to "?".
jar -xf dist/grouper.war WEB-INF/classes/resources/grouper/nav.properties
grep connexion WEB-INF/classes/resources/grouper/nav.properties | od -c
0000000 l o g o u t = D ? c o n n e x i
0000020 o n \n s i m p l e M e m b e r s
0000040 h i p U p d a t e . l o g o u t
0000060 T e x t = D ? c o n n e x i o n
0000100 \n
0000101

# If one sets the default java locale to fr_FR, the encoding is
# preserved:
env LANG=fr_FR ant clean war
jar -xf dist/grouper.war WEB-INF/classes/resources/grouper/nav.properties
grep connexion WEB-INF/classes/resources/grouper/nav.properties | od -c
0000000 l o g o u t = D 351 c o n n e x i
0000020 o n \n s i m p l e M e m b e r s
0000040 h i p U p d a t e . l o g o u t
0000060 T e x t = D 351 c o n n e x i o n
0000100 \n
0000101

- Would it be possible that "ant war" did not depend on the default
java locale to produce the correct encoding in the generated files
in the war archive?


As for tomcat, as mentioned in my previous message, even if the
deployed nav.properties is correct, the Grouper Lite UI is also
dependent of the default java locale (but not the Admin UI). To
continue the example, if the script that starts tomcat leaves the
default java locale to "C" (or explicitly sets it to "C", eg. with
"LANG=C; export LANG"), one has:

cp dist/grouper.war ~tomcat/webapps
/etc/init.d/tomcat restart
# the nav.properties file after deployment is still OK:
grep connexion
~tomcat/webapps/grouper/WEB-INF/classes/resources/grouper/nav.properties|od
-c
0000000 l o g o u t = D 351 c o n n e x i
0000020 o n \n s i m p l e M e m b e r s
0000040 h i p U p d a t e . l o g o u t
0000060 T e x t = D 351 c o n n e x i o n
0000100 \n
0000101

Now if one uses "Log in to Prototype Lite UI", the log out label from
the nav.properties file ("simpleMembershipUpdate.logoutText" property)
is transmitted to the browser as "D?connexion", as shown in this
packets capture made with a snooper (the hex code of "?" is 3F, non
ASCII characters would be represented by the placeholder "."):

grep connexion /tmp/packets.txt
0150 5c 22 3e 44 3f 63 6f 6e 6e 65 78 69 6f 6e 3c 5c \">D?connexion<\

But after switching to the Admin UI, its log out label ("logout"
property) is transmitted and displayed properly.

- Would it be possible that the Grouper Lite UI did not depend
on the default java locale of tomcat to preserve the encoding of
characters transmitted to the browser?


Best regards,
Dominique
--
Mr Dominique Petitpierre, Dominique.Petitpierre(at)unige.ch
Division Informatique, University of Geneva, Switzerland
http://www.unige.ch/dinf/



Archive powered by MHonArc 2.6.16.

Top of Page