Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Farsi & Struts Resource Bundles

  Asked By: Adelisa    Date: Jun 03    Category: Java    Views: 1270
  

Does any body know how to use farsi in Struts Resource Bundles.
I've tried the followings but I get Nothing.

1- I use uniCodes in my resource bundles
like hello = \u2134\u234f\u123a......
2- I wrote farsi against my keys Example:
Hello = ÓáÇã and I got nothing.

The result html does not show farsi fonts.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Reginald Thomas     Answered On: Jun 03

There is three possibilities:

You may have problem with Resource Bundle in general,
be sure that this file is placed in WEB-INF/classes.

But if you have problem with the farsi  characters, you
can save the Resource Bundle file as Unicode and use
native to ascii command to generate the equivalent
ascii code.

Yet another problem may be bad fonts  of html.
If you let me know exactly what the output is, I can
tell you what the problem, exactly is!

 
Answer #2    Answered By: Seth Anderson     Answered On: Jun 03

The problem is not in your resource  file.
Because i use unicode & havn't any problem.
My resource file something like thie:

title=\u0627\u0637\u0644\u0627...
name=\u0639\u0646\u0648\u0627\u0646
letter_pre_code=\u0643\u062f
sequence_in_parent=\u0627\u0648\u0644\u0648\u064a\u062a
desc=\u0634\u0631\u062d

and it's work good.

 
Answer #3    Answered By: Jeanne Lawson     Answered On: Jun 03

you mast insert # fa: before your key in properties file. for example:
#fa:hello=...
and set characterset to utf_8 such as:


<%@ page contentType="text/html; charset=utf-8" %>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
</head>

 
Didn't find what you were looking for? Find more on Farsi & Struts Resource Bundles Or get search suggestion and latest updates.




Tagged: