473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

String not displayed properly.

Hello,
I am facing a weird problem while displaying my String in JFrame while
prototyping Hindi character display
To explain this a little bit.
I am pushing unicode characters into a Varchar2 field in the Database
and then trying to retrieve it at run time.

From the database, using JDBC, I obtain a String like
"\u0916\u093e\u0924\u093".
I pass this string to a Frame

class testText extends Frame
{
TextField t = null;
testText(String str)
{
try {
//System.out.println(str);
t = new TextField();
t.setLocale(new Locale("hi","IN"));
t.setFont(new Font("Naidunia",Font.PLAIN,14));
t.setText(str);
add(t);
this.setSize(400,400);
this.setVisible(true);
}catch(Exception e){
e.printStackTrace();
}
}
}

This code should print a Hindi text like
"खाता" in the TextField but what it prints is
""\u0916\u093e\u0924\u093".
Although, a code like
class testText extends Frame
{
TextField t = null;
testText(String str)
{
try {
//System.out.println(str);
t = new TextField();
t.setLocale(new Locale("hi","IN"));
t.setFont(new Font("Naidunia",Font.PLAIN,14));
//t.setText(str);
t.settext("\u0916\u093e\u0924\u093");
add(t);
this.setSize(400,400);
this.setVisible(true);
}catch(Exception e){
e.printStackTrace();
}
}
}
prints "खाता".
Pretty strange as it doesnt seem logical.
Please help me out with this
Thanks,
Gagan
Jul 17 '05 #1
0 1230

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Krzysztof Fink-Finowicki via .NET 247 | last post by:
I have problem with TEXTAREA HTML tags in my Web application (MSIE 6.0). User fills-in content of TEXTAREA on HTML dialog window. After accepting, content of TEXTAREA from dialog window is...
11
by: Sims | last post by:
Hi, I have a function that looks something like .... void Function( std::string &oldval ) { int iSome_size = xxx; // get some size char *tmp = NULL; tmp = new char;
11
by: Nobody | last post by:
Heres the deal... I have an application where I have a list (as in a Windows list control, but thats not important) displayed to the user. I sort this list based on the list controls sort function...
24
by: John Smith | last post by:
I want to shorten a string by replacing the last character by '\0'. The following code displays the string. It works fine. It's in a loop and different strings are displayed without problems....
3
by: jcouse | last post by:
I am trying to find if a string exists in a file. If it doesn’t, it should return a “-1” and I’ll make my decision based on that Here is a sniplet of the text file game name mapp...
3
by: CrimeMaster | last post by:
Hi i have made a Key under the HKEY_LOCAL_MACHINE\Software\My Toolbar\Setting. i have placed some values under the Setting key. i m trying to access the values under that key and want to map them...
28
by: Joe Reynolds | last post by:
this is kinda off topic, but not totally. i have an ASP page that pulls text from a database, stores it in a variable, then uses <%= variable %to write the text inside an html table. the problem...
12
PEB
by: PEB | last post by:
Hi everybody, I've a recordset based on a table. Each field in the table is retreated in the recordset, so that the length of the field increases 5 times! The retreatement is using this kind...
4
by: ssylee | last post by:
I have set my year value in the register on my RTC (DS1302) to be 2008 using this code: // This function sets the year on the RTC // Note: The year takes in only the last two digits of the year...
4
by: farhanm84 | last post by:
I have a requirement to display the link in colum format in IE browser. The link text is associated with an image (double arrow). Since the text of the link is large enough to set in one of the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.