473,569 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\u 0924\u093".
I pass this string to a Frame

class testText extends Frame
{
TextField t = null;
testText(String str)
{
try {
//System.out.prin tln(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(40 0,400);
this.setVisible (true);
}catch(Exceptio n e){
e.printStackTra ce();
}
}
}

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.prin tln(str);
t = new TextField();
t.setLocale(new Locale("hi","IN "));
t.setFont(new Font("Naidunia" ,Font.PLAIN,14) );
//t.setText(str);
t.settext("\u09 16\u093e\u0924\ u093");
add(t);
this.setSize(40 0,400);
this.setVisible (true);
}catch(Exceptio n e){
e.printStackTra ce();
}
}
}
prints "खाता".
Pretty strange as it doesnt seem logical.
Please help me out with this
Thanks,
Gagan
Jul 17 '05 #1
0 1240

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

Similar topics

0
2336
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 copiedto TEXTAREA on main HTML window: wndTxtArea.value = dlgTxtArea.value; Then user may take the text for editing in HTML dialog windowonce more. ...
11
2483
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
2961
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 (again, its not important that its Windows) which ends up calling a compare function in my code: int CompareFunc(char* str1, char* str2) { } ...
24
9026
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. ----------------------------------------------------------- temp= strlen(aGroup); for (i=0; i< temp;i++) printf(" %d %d %c\n", i+1,temp,aGroup);...
3
1273
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 description "Mappy (US) year 198 manufacturer "Namco history "\nMappy (c) 03/1983 Namco. \n\n- TRIVIA: \n\nLicensed to Bally Midway for US manufacture...
3
1129
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 to a dialog box ,means they should be visible in their corresponding Edit controls when i display the dialog.i have used the following code in...
28
1707
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 im having has to do with wrapping. if the line of text is longer than the table (or column) is wide, then the whole table is blown apart and grows...
12
2860
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 of expressions in the query: Myf1:func() ..........
4
1620
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 only // and valid for only 2000 to 2099 void set_year(unsigned int year) { unsigned int year_temp; unsigned char year_write = 0;
4
3373
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 column width the text and the image are messed up. When I tried removing half of the link text then it is properly displayed. For example, from the...
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.