Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Farsi & Struts Resource Bundles

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

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.



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:


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:
and set characterset to utf_8 such as:

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

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