You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by MAQS Developer <ma...@gmail.com> on 2012/07/31 07:31:14 UTC

Struts 1 : Arabic Characters Issue

Dear All,

I have developed an application using Struts 1.3. and running on IBM WAS 7.
Application supports English and Arabic languages. English locale is
working fine but while in Arabic locale message labels (from properties
resource bundle) display question marks "????" instead of the Arabic
characters. It does not happen always so I am unable to reproduce the
error. In case if this happens after refreshing the page, labels display
proper message.

I am using following code to set Arabic Locale in application;

*request.getSession().setAttribute(Globals.LOCALE_KEY, new Locale("ar",
"AE"));*

To ensure character encoding to be UTF-8, I set it using below code.

<%@page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("UTF-8");%>


Does any one has idea ????? Please respond me ASAP.


Regards,
M. Qadeer Saeed

Re: Struts 1 : Arabic Characters Issue

Posted by "maqs.developer" <ma...@gmail.com>.
I am using bean message tags to display message from resource bundle.

<bean:message key="message.key"/>



--
View this message in context: http://struts.1045723.n5.nabble.com/Struts-1-Arabic-Characters-Issue-tp5710346p5710374.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 1 : Arabic Characters Issue

Posted by MAQS Developer <ma...@gmail.com>.
I display labels using message keys;

<bean:message key="page.common.label1" />


On Tue, Jul 31, 2012 at 2:47 PM, Eric Tse <ek...@gmail.com> wrote:

> How did you output your message label in jsp?
>
> Eric@mobile
>
> On 31 Jul, 2012, at 1:31 PM, MAQS Developer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts 1 : Arabic Characters Issue

Posted by Eric Tse <ek...@gmail.com>.
How did you output your message label in jsp?

Eric@mobile

On 31 Jul, 2012, at 1:31 PM, MAQS Developer 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1 : Arabic Characters Issue

Posted by "maqs.developer" <ma...@gmail.com>.
Thank you Martin,

I have double checked the Client and Server Operating systems. 
Both support Arabic language. And Locale settings are also appropriated to
take Arabic language input and display as well. 

Any suggestion .... ?


Regards,
Muhammad



--
View this message in context: http://struts.1045723.n5.nabble.com/Struts-1-Arabic-Characters-Issue-tp5710346p5710575.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1 : Arabic Characters Issue

Posted by Martin Gainty <mg...@hotmail.com>.
Maws

You have to switch the IME Input Method Editor you are current;y using to enable Arabic characters in Arabic foncts
http://en.wikipedia.org/wiki/Input_method_editor 
and then you will need to adjust your Display (Browser) to support the character set and locale
I dont know what OS you have but if you are supporting Arabic character set and some locale-specific implementation this is how you would
go about installing the Input(IME) and Display characteristics for Windows XP
http://www.datacal.com/t-XP-Arabic-Setup.aspx

Conversely for RH Lunix (or other hosting environment) you will need to enable your OS to support Arabic Input and Display this will help
http://aramedia.com/ae-masterredhat9.htm

Bear in mind you since you are using DBCS you are using 2 characters to support one code point (character) so the IME will need the capability of entering both characters
as well as displaying those DBCS characters in Fonts (which support Arabic character set) this would help if you want to display DBCS characters in IE
http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/writing-in-arabic-in-explorer/ac6c9e3a-6dc7-43d0-bdcc-1e61d7cc28dc

In any case you would be well advised to retain a resource who is fluent in arabic to help you with your project

Bon Chance,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.ic

> Date: Sun, 5 Aug 2012 22:50:48 -0700
> From: maqs.developer@gmail.com
> To: user@struts.apache.org
> Subject: RE: Struts 1 : Arabic Characters Issue
> 
> Dear Martin,
> 
> Can you elaborate It please ..... 
> 
> Application works fine most of the time. Only sometimes "?????" are
> displayed instead of proper Arabic text, and refreshing the page starts
> displaying correct letters.
> 
> I have set the character encoding at JVM of application server.....
> 
> 
> 
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Struts-1-Arabic-Characters-Issue-tp5710346p5710375.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
 		 	   		  

RE: Struts 1 : Arabic Characters Issue

Posted by "maqs.developer" <ma...@gmail.com>.
Dear Martin,

Can you elaborate It please ..... 

Application works fine most of the time. Only sometimes "?????" are
displayed instead of proper Arabic text, and refreshing the page starts
displaying correct letters.

I have set the character encoding at JVM of application server.....



--
View this message in context: http://struts.1045723.n5.nabble.com/Struts-1-Arabic-Characters-Issue-tp5710346p5710375.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 1 : Arabic Characters Issue

Posted by Martin Gainty <mg...@hotmail.com>.
i believe you will need to implement a character set which implements DBCS at the server which hosts your struts webapp and delivers (Unicode) using DBCS as a response.
Once you are able to input the characters from the selected character-set and language-locale and display the characters from the selected character-set and language-locale
then you will be able to implement the UTF-8 character-set in your web applications stack.
UTF-8 is a special character designed to show every character from every language as 'code-points' the definition which follows:

"UTF-8 is therefore a multi-byte variable-width encoding. Multi-byte because a single character like Я takes more than one byte to specify it. Variable-width because some characters like H take only 1 byte and some up to 4."

http://coding.smashingmagazine.com/2012/06/06/all-about-unicode-utf8-character-sets/

The onus of ensuring all DBCS input and display of DBCS characters will fall on your shoulders .. Unicode entered data must also be stored in your Database as UTF-8 character-set
http://docs.moodle.org/23/en/Converting_your_MySQL_database_to_UTF8

HTH
Martin..
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> Date: Tue, 31 Jul 2012 09:31:14 +0400
> Subject: Struts 1 : Arabic Characters Issue
> From: maqs.developer@gmail.com
> To: user@struts.apache.org
> 
> Dear All,
> 
> I have developed an application using Struts 1.3. and running on IBM WAS 7.
> Application supports English and Arabic languages. English locale is
> working fine but while in Arabic locale message labels (from properties
> resource bundle) display question marks "????" instead of the Arabic
> characters. It does not happen always so I am unable to reproduce the
> error. In case if this happens after refreshing the page, labels display
> proper message.
> 
> I am using following code to set Arabic Locale in application;
> 
> *request.getSession().setAttribute(Globals.LOCALE_KEY, new Locale("ar",
> "AE"));*
> 
> To ensure character encoding to be UTF-8, I set it using below code.
> 
> <%@page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> <% request.setCharacterEncoding("UTF-8");%>
> 
> 
> Does any one has idea ????? Please respond me ASAP.
> 
> 
> Regards,
> M. Qadeer Saeed