** Plz help me in displaying unicode character **

Hi,
I hava a problem with the following code. Actually I want to display some arabic character with the help of unicode. Plz go through the following code.
import java.awt.*;
class Unicode extends Frame
public static void main(String args[])
Frame f = new Frame("Unicode");
f.setSize(200,200);
String str="\u0600";
TextField tf=new TextField(str);
f.add(tf);
f.setVisible(true);
I m trying to print that character on a textfield. However, this is not the requirement but for only testig purpose. I get the character '?' in the resulting textfield. plz tell me that how can I use unicode to print other languages character anywhere like on awt, swing or in html. plz reply soon . Thanks
Fahad Ahmed

\u0600 is an unassigned Unicode character, so there's no way to do that. However I assume you mean you want to display Arabic characters such as \u0627, Arabic Letter Alef (&#x0627). Then you need to find a font that can render those characters properly, and assign that font to the TextField using its setFont() method.
I notice you are using AWT, which probably means you are trying to do this in an applet. If that's the case then "find a font and use it" is going to be a big problem, because you don't know what fonts your clients' computers have available.

Similar Messages

  • Display Unicode Character in Swing Objects

    I am trying to display Chinese Characters using Swing GUI.
    I created Unicode strings using escape character \uXXXX
    I displayed \u4e00 successfully
    However when I tried to display \ub8db i got a square box displayed instead.
    I am using: Winnt ver 4 ,RichWin 97
    private Object listData[] = {
    new String("\ucfe3\ub8db"), // Two boxes displayed in list
    new String("\u4e01\u4e00"), // Characters displayed correctly
    new String("Third selection")
    To hope to get some replies ASAP. Thanks!!!
    Regards,
    Patrick

    Hi Patrick,
    Yeh, fonts are rather ubiquitous when it comes to internationalization. The fact that the font.properties files still exist confuses a lot of people. In reality, Sun doesn't support them any more, and they aren't all that useful if you're actually deploying your code onto other machines.
    So, to answer your questions... :D
    1) Each component will have a font set on it. To start with, each component will end up with the JDK default, usually the Dialog font in Java. From memory, I think this maps to Arial on Windows systems, though I'm not sure if RichWin alters this in anyway, as I haven't used it myself.
    You can check the available fonts on your machine by calling:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
    This returns an array of strings. You can basically create a new font from any of the names that appear in here. For instance, if one of the strings was "Arial Bold", you could create the following font:
    Font myFont = new Font("Arial Bold", Font.PLAIN, 12);
    2) The best way is to simply create the font you want on startup. If you can't rely on the font
    you need being installed on every machine you plan to run your program on, the best solution is to either install it on startup, or carry it around with you.
    Have a look at Font.createFont(), as it allows you to create a new Font object from a *.TTF file (a TrueType font). In JDK1.3, this is buggy, leaving a large temp file behind every time you run it, but I've already tried this under Merlin Beta, and it's fixed and working fine.
    The reason this is handy is because the font we keep talking about on here, Arial Unicode MS, is a TrueType font. So you can carry the font around with you, and load it on startup using this call.
    Arial Unicode MS is a 23Mb font, but it's capable of displaying just about any character you could imagine.
    The trick from there, once you've loaded your font, is to make sure you call setFont() on just about any component you create. Menus are a cow - you've got to listen for events, as the dropdown menus don't always get the font straight away. But other than that, it's fairly simple.
    3) The short answer is to call the getAvailableFontFamilyNames() call above, and look for any familiar font names. If you can't find any, you know you're not going to be able to display anything.
    Windows seems to have standard fonts for the international languages. In Chinese, this is SimHei for Simplified (mainland) Chinese, and MingLiU for Traditional (Taiwanese) Chinese. Simplified covers about 30,000 Kanji, while Traditional covers around 80,000.
    So for Chinese, you would look for "SimHei" and "MingLiU", plus any of the fonts capable of displaying anything, like "Arial Unicode MS". If none of these strings are in the array, you may want to carry the Arial Unicode MS installer around with you and execute it. This file is about 11Mb, and is available as a download off the Microsoft website.
    4) Probably about the most useful thing I've come across is the Sun I18N tutorial on this very website. There isn't a heck of a lot out there, unfortunately. About the only other things I can recommend are http://www.unicode.org for the Unicode character codes, and http://www.njstar.com for NJStar Communicator, which you'll find useful if you're working with Chinese.
    Oh, and watch this forum, of course. ;D
    Hope that helps!
    Martin Hughes

  • How to display unicode character in jsp pages?

    i have to display user need language using unicode character according to user selected in radio button arabic or german in jsp
    pages. can you explain how i have to code?

    Hi,
    Visit the following URL http://java.sun.com/docs/books/tutorial/i18n/ .
    It will help you.
    bye for now
    sat

  • Plz help me, no display output during boot up of 715 workstation

    now i have a HP 715 model workstation,today, conneted hp monitor..but can't display output during system boot up so i tried  solve this problem,1)changed battery2)removed HDD after reboot system and press ESC key    => now can't use Keyboard..not working key board3)Press Tap key.. Just i think, this problem is system configulation problem. not monitor problem..so i found internet website..but now i can not change configulation who know this problem.plz help me  

    one question in html submit the reslut stored jdbc that value shows barchartAll your base are belong to us!
    You know, while I understand that English isn't your first language (neither is it mine) and there's no need to be perfect: if you can't write an understandable post yourself, consider asking someone to do it for you.

  • Plz help me with displaying image.....

    hai friends,
    i am doin a simple project for my school in jsp and servlets.... actually my problem is very simple i tink ...but am unable to track out....and am new to jsp...actually i want to insert an image near my text...but am unable to display image...i simple get an ' X ' mark and the alternate text instead of the image ...is it tat my browser is unable to display images?? can i change the settings of my browser?? plz tell me how to do it ?? i hav pasted my code also....
    <tr>
                   <td valign=top width=100>
                   <img src="/images/icon.bmp" align=left width=30 height=30 alt="image"><a href="/project/servlet/SubforumviewServlet?name=<%= forname %>"><%= forname %></a>
                   </td>
              </tr>
    that forname is the name of my link..
    i hav another doubt also...is CSS like a template?? do we need to write the code or we can just include it to our jsp?? cos i need to enhance my jsp page to look more professional lik websites... sorry if my question is really childish.....plz help me !!!! thanx in advance..

    Hi...
    I tried your code and its working fine..I think the problem is with the location of your image. In the src attribute, give the correct location of the image. If you are giving /images/im.bmp, the folder images should be in the same directory as your jsp. Hope it help.
    Regards,
    Cochu.

  • Regarding displaying unicode

    Hello javaGurus!
    <Please Help me regarding displaying unicode>
    I am new to javaInternationalization,
    Till now i studies. Java Internationalization tutorial at http://java.sun.com/docs/books/tutorial/i18n/index.html and understand basic Structure.
    I have some problem displaying the unicode characters, such at, Arabic, and japneese.
    - How to display unicodes in applet?
    - How can we set the the Japneese, English, Arabic fonts in one application, which run on windows environment.
    - From where i can get the font s?
    Regards,
    waseem

    If you specify a String object with the unicode sequences (of the form "\u####\u####"), you can simply display it with the method setText(String) of the class javax.text.JTextComponent (or javax.JTextArea), for example. If you specify a String object with your own encoding in your source code, you can compile it with the command:
    javac -encoding <encodingName> fileName
    On Windows OS, the font ArialUnicodeMS will display almost all characters you are to show.
    You can find downloadable fonts in almost any search engine.
    - The following can be additional material for studying.
    http://java.sun.com/j2se/1.4/docs/guide/intl/fontprop.html
    http://developer.java.sun.com/developer/qow/archive/65/index.html

  • Unicode character not displaying when PDF is created using PDFMaker

    Using Adobe Acrobat Pro 9
    Our company letterhead contains a special character (Unicode 25AA "Black Small Square"). When a PDF is created of a Microsoft Word document (2003 or 2007) using the PDFMaker, that character is not displayed in Acrobat (shows as whitespace). Strangely enough, if I search for the character in that PDF file using the Acrobat search function (query "u/25AA"), the search finds the character, but again, it is displayed as whitespace.
    However, if I create a PDF from that same Word document by printing to Adobe PDF, the character displays correctly in Acrobat. Additionally, if I do a SaveAs to PDF (Using the Microsoft plugin), the character displays correctly in Acrobat. This leads me to believe that muy issue is related to the PDFMaker (as opposed to the PDF printing function) and how the character is embedded into the PDF file. I have tried opening the PDF in other versions of Acrobat, but I get the same result.
    Any suggestions? We would like to utilize the convenience of the PDFMaker for our letters and reports, and not have to use the print function. I can email a sample of all the PDF's I spoke of upon request, but the issue should be reproducable using the following steps:
    1. Open MS Word and type (or copy from the Character Map) unicode character 25AA in Arial font.
    2. Save Word file.
    3. Use PDFMaker to create PDF file.
    4. Open PDF file and view results.
    Any guidance or help is appreciated.
    Phil Hinton

    First, check the fonts in the PDF to be sure that they are not embedded (you are likely correct that there is a problem). What job settings are you using. Try the press or print. Also check the job settings to be sure that ALL fonts are to be embedded.
    Also, check the log file of Distiller (set it to not be deleted in the settings). If there is an issue with the license of the font then the font will not be embedded. In that case you need to find a licensed version of the font or change to a different font.

  • Unicode character not displaying correctly

    when i am stroring Unicode Character in Oracle 8 DB .The Stored Character are not displayed correctly . Through sql client seen as '�' .Altough through JSp it displays correct value &#38598; (in japanese)
    My client wants to see through sql also same value . Pls help wat is wrong. More info :
    Oracle is set up in UTF-8 Format.
    Using code as below before inserting in DB
    String temp =product.getDescription();
    String newResult = new String(temp.getBytes("UTF-8"), "UTF-8");

    TryString newResult = new String(temp.getBytes(default),>
    "UTF-8");// "default" is a String of the name of
    default encoding on the part of client
    Sorry there was a slip. Try the following.
    String newResult = new String(temp.getBytes(default));

  • ADF Unicode character ï not displaying fine in af:outputFormatted

    Hi,
    I have a database column that stores unicode characters as : "&#239;"
    Eg : Hello&#239;
    Now &#239; represents a Unicode character.
    I am using an af:outputFormatted UI element to display this.
    The encoding for the VO which reads from the database is "UTF-8" and the PageDefinition file for the Page is also "UTF-8"
    But it is not shown as the Unicode Character but rather &#239;
    I also tried replacing it as \u00E9 and it disn;t work either too.
    Kindly help.

    <af:outputFormatted id="uni" value="#{'&#239;'}"/>
    The above code works for me so assuming your string have the proper value it should also work for you.

  • I have problem with daq..when it is connected with laptop it asks for all the options like sampling rate etc..It displays building VI and it stops..it is not processing further..cau u plz help to solve this problem

    i hav problem with daq initialisation...plz help to solve the above mentioned issue

    Hi muthu,
    we also have a problem: to less information…
    - What is connected to your laptop?
    - What is "it" in "it displays building VI"? Do you use the DAQ Assistent ExpressVI?
    - What means "plz"?
    And could you please put less text in the title of your message and more text (with relevant information) into the message body?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • HT201263 After updating to the ios6 my ipod was going on and off displaying the apple icon and then had a white screen that had multi colors on it. Then it had a blue screen.plz help me

    I was updating my iPod touch 4g to the ios6 and it told me to hook it up to the iTunes and so I did. After doing that the computer told me to restore I tried and it didn't work. My ipod then was Turing on and off displaying the apple icon then my screen turned white with rainbow colors going down the screen then at some point my ipod had a multi colored blue screen. The screen was no longer blue after I let it die. Plz help I can't find any solutions.

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Unable to display Chinese character in non-unicode system properly.

    Hi, all
    My system has been upgraded from 4.6C to 6.0 which is non-unicode system. Chinese characters with long length will be cut and cannot wrap automatically. But it's OK to alphabetes. How could I resolve this?
    Thanks..
    TD. Wei

    The simple and easy way to check
    non-unicode character sets are not supported on unicode system any longer. Am I right?
    Transaction code i18N
    Select
    trouble shooting --> printing  test --> smartforms --> multiple scripts, select your output device and see print preview. it will display all supported characters.
    I guess, above information will be useful for closing the thread.
    Regards,
    SaiRam

  • Plz help me in escaping the starting character

    Actually i'm getting the name from textfeild and storing it in string.but wht i want is whn the user enters the first character i.e., either " or | in the Textfeild i need to trim the string i.e., it should not take those characters if they give them also wht should i do for this .plz help me it is urgent

    You could try having a keypress action listener. If the user presses a key that you don't want to show, the action listener can handle the event.

  • How to display a unicode character in a list ?

    Hi,
    sorry if the question seem to be really easy but I doenbt found of to diaply a special character in a list.
    I thank that it was easy :
    1) display tha windows character map
    2) copy paste the charatcter in the ABAP Program to obtain something like this :
    write '&#8804;'.
    But the displayed character is '#' . So, could you tell me how to display a gived unicode character ?
    Regards,
    morgan

    Hello Morgan,
    you need SAP system with unicode. You can check it from every dynpro/mode:
    System->Status: SAP System dada  Unicode system: yes
    I have checked your sign '&#8804;' on my not UC system: is displayed: '='.
    Bye,
    Peter

  • In my smart form why main's content din't display in print preview?Plz help

    In my smart form why main's content din't display in print preview?Plz help me.
    Regards
    Indu
    Moderator message: too vague, help not possible, please describe problems in all technical detail when posting again.
    Edited by: Thomas Zloch on Jan 5, 2011 3:27 PM

    make sure u've specified da style in output options of text element as
    TIMES 10 in style field and select da desired paragraph and charcter format in general attributes tab of da text element.activaTE AND CHECK.
    if problem still persists u can ask again.
    reward points if it helps.

Maybe you are looking for

  • Images being compressed or resized before printing ??

    I have a 50MB PNG image that I just printed using the built in Kodak printing system. When the image was actually being uploaded, though, it was only 3.2MB in size. What happened to the photo? Did it get converted to a JPEG or PDF? Was it resized? Wh

  • L10: Deleting folders - should be easy or is it?

    Hi ive just brought a new satalite L10 and im having a problem with it. I cannot do the simplest thing - when i create a new folder on my desktop or document folder and try to rename it or delete it - it wont work and the whole laptop freezes!!! Cons

  • Partner deletion in va01/va02

    Hi all, How can i prevent deletion of particulat non mandatory partner in sales order transactions VA01 and VA02. is there a user exit to achieve the requirement. Thanks and regards

  • Strange Icon (Sad Ipod) won't respond

    My Ipod first froze when I chose a song last night. Now when I turn it on, the ipod shows the apple icon. After a few seconds of the apple icon and some "clicking" noises (as if the hard drive keeps on trying to restart), the strange icon (Sad Ipod)

  • Re-sales order

    Hello guru's             When i am creating sales order it's showing no sales area could be determine.still am moving forward it showing some other dialog box in that it saying a new sales area is redetermining. thanks&regards ram bharathi