Jump to content
Changes to the Jaspersoft community edition download ×

Unicode text in Non Static Text Field


Recommended Posts

By: Himanshu - himanshugarg

Unicode text in Non Static Text Field

2006-07-17 05:26

Hello,

 

I am able to display Unicode text alright as static text. However when I get the same from a Resource Bundle I see junk characters. What must I do.

 

Thank You,

Himanshu.

 

PS:-

IPC_hi_IN.properties

1=कà¥à¤› नहीं

13=हतà¥à¤¯à¤¾

 

Bundle.java

import java.util.*;

 

public class Bundle {

public static String getString(String head, Integer key, Locale lc)

{

String s = null;

try {

ResourceBundle rb = ResourceBundle.getBundle(head, lc);

s = rb.getString(key.toString());

} catch (MissingResourceException e) {

System.out.println(" " + e);

s = null;

}

return s;

}

public static void main(String args[]){

Locale lc = new Locale("hi", "IN");

System.out.println(Bundle.getString("IPC", 13, lc));

}

}

 

Extract from jrxml

<textFieldExpression class="java.lang.String"><![CDATA[bundle.getString("IPC", $F{category}, new Locale("hi", "IN"))]]></textFieldExpression>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...