Unicode Character - getString - ResultSet - Java.

Hello experts,
I am trying to query some records, containing unicode character of fields. When i execute the query in Oracle 9i, i am able to see the unicode character in the query result.
When sending the same sql from java, though i am getting same count of records, but the field name containing special characters, are not being visible in the rs.getString(1) method.
Could you please help me, on getting the special character in the output.
Your direction in this regard is highly appreciated...
Regards,
girig.

Basically, i am using eclipse Ide, and seeing the
output in the console window.Try printing the unicode hex value of the characters rather than the charcters. This way you will not be worried about whether or not the font used by the display actually has glyphs for the characters.

Similar Messages

  • Unicode Character Sets in Java

    I am trying to port code from a PowerBuilder 10.5.1 Build 6021 environment to Java and I am encountering getting the same value for the Euro character in Java and PowerBuilder.
    I get a value of 20AC (8364 in decimal) in Java which is consistent with ISO-8859-15, but I get a value of 128 in PowerBuilder.
    This is only a small example and perhaps not strictly a Java question, but if anyone has any suggestions, I would appreciate it.

    In the ISO-8859-x encodings, each character is represented by one byte, but the numbers 128-159 are not used. The Windows extensions of those encodings, like windows-1252, map those unused numbers to useful characters like curly quotes and the Euro symbol (and create compatibility problems like this one in the process). PowerBuilder is obviously using one of these Windows encodings. However, there are several points in the development process where character encodings come into play, so we'll need more info. Does the problem occur when you compile the code, or when you run it? If it's at run time, does it happen when you're reading text from a file, a database, or some other source? And how exactly does the problem manifest?

  • Unicode Literal to Unicode Character

    I have a list of all the unicode characters (00C1, 00E1, 0103, etc.).
    I am displaying their data as \u00C1 (in a java string: System.out.println("\\u00C1");)
    How would I go about converting that literal string to the actual unicode character?
    I want \\u00C1 to become the actual \u00C1 character.
    All I'm really doing right now is letting the user enter in that data and then parsing their string for all unicode specifications and then turning them into the actual unicode characters.

    char c = (char)Integer.valueOf("00C1", 16).intValue();

  • 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

  • ** 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.

  • Unicode, UTF-8 and java servlet woes

    Hi,
    I'm writing a content management system for a website about russian music.
    One problem I'm having is trying to get a java servlet to talk Unicode to the Content mangament client.
    The client makes a request for a band, the server then sends the XML to the client.
    The XML reading works fine and the client displays the unicode fine from an XML file read locally (so the XMLReader class works fine).
    The servlet unmarshals the request perfectly (its just a filename).
    I then find the correct class, and pass it through the XML writer. that returns the XML as string, that I simply put into the output stream.
    out.write(XMLWrite(selectedBand));I have set correct header property
    response.setContentType("text/xml; charset=UTF-8");And to read it I
             //Make our URL
             URL url = new URL(pageURL);
             HttpURLConnection conn = (HttpURLConnection)url.openConnection();
             conn.setRequestMethod("POST");
             conn.setDoOutput(true); // want to send
             conn.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" );
             conn.setRequestProperty( "Content-length", Integer.toString(request.length()));
             conn.setRequestProperty("Content-Language", "en-US"); 
             //Add our paramaters
             OutputStream ost = conn.getOutputStream();
             PrintWriter pw = new PrintWriter(ost);
             pw.print("myRequest=" + URLEncoder.encode(request, "UTF-8")); // here we "send" our body!
             pw.flush();
             pw.close();
             //Get the input stream
             InputStream ois = conn.getInputStream();
                InputStreamReader read = new InputStreamReader(ois);
             //Read
             int i;
             String s="";
             Log.Debug("XMLServerConnection", "Responce follows:");
             while((i = read.read()) != -1 ){
              System.out.print((char)i);
              s += (char)i;
             return s;now when I print
    read.getEncoding()It claims:
    ISO8859_1Somethings wrong there, so if I force it to accept UTF-8:
    InputStreamReader read = new InputStreamReader(ois,"UTF-8");It now claims its
    UTF8However all of the data has lost its unicode, any unicode character is replaced with a question mark character! This happens even when I don't force the input stream to be UTF-8
    More so if I view the page in my browser, it does the same thing.
    I've had a look around and I can't see a solution to this. Have I set something up wrong?
    I've set, "-encoding utf8" as a compiler flag, but I don't think this would affect it.

    I don't know what your problem is but I do have a couple of comments -
    1) In conn.setRequestProperty( "Content-length", Integer.toString(request.length())); the length of your content is not request.length(). It is the length of th URL encoded data.
    2) Why do you need to send URL encoded data? Why not just send the bytes.
    3) If you send bytes then you can write straight to the OutputStream and you won't need to convert to characters to write to PrintWriter.
    4) Since you are reading from the connection you need to setDoInput() to true.
    5) You need to get the character encoding from the response so that you can specify the encoding in           InputStreamReader read = new InputStreamReader(ois, characterEncoding);
    6) Reading a single char at a time from an InputStream is very inefficient.

  • Unicode character doesn't display integral symbol

    I tried using unicode character 222B in my program to get the integral symbol.
    It works well in jdk1.2, but if i try to run the same program in jdk1.3 , it's returning delta symbol.
    What is the possible solution, such that i get the integral symbol in jdk1.3 as well as both?
    submitted by
    Viru

    Hi Viru,
    Have a look at this piece of code:
    import java.awt.*;
    public class CharacterTest
         public static void main(String[] args)
              Frame f = new ApplicationFrame("Character test")
                   public void paint(Graphics g)
                        Graphics2D g2 = (Graphics2D)g;
                        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
                        Font font = new Font("Arial Unicode MS", Font.PLAIN, 32);
                        g2.setFont(font);
                        g2.drawString("Character \u222B", 40, 80);
              f.setVisible(true);
    [\code]
    I don't have any problems using 32.
    Klint                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • Additional CR when printing unicode character

    Hello,
    the following code prints two lines on a printer. The second line contains an escaped unicode character. When running the example code I can't even see the unicode character on the paper; but in my original application it is visible. So this is not the problem. But always an additional carriage return is inserted after the unicode character, thus overprinting the beginning of the line with the remaining text. This did not occur in java 6 if I remember correctly. Is there any workaround for this?
    Regards
    J.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    public class HelloWorldPrinter implements Printable, ActionListener {
        public int print(Graphics g, PageFormat pf, int page) throws
                                                            PrinterException {
            if (page > 0) return NO_SUCH_PAGE;
            Graphics2D g2d = (Graphics2D)g;
            g2d.translate(pf.getImageableX(), pf.getImageableY());
            g.drawString("Hello world!", 100, 100);
            g.drawString("Now the line with a unicode \u2259 character.", 100, 120);
            return PAGE_EXISTS;
        public void actionPerformed(ActionEvent e) {
             PrinterJob job = PrinterJob.getPrinterJob();
             job.setPrintable(this);
             boolean ok = job.printDialog();
             if (ok) {
                 try {
                      job.print();
                 } catch (PrinterException ex) {
                      System.out.println(ex);
        public static void main(String args[]) {
    //        UIManager.put("swing.boldMetal", Boolean.FALSE);
            JFrame f = new JFrame("Hello World Printer");
            f.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
               System.exit(0);
            JButton printButton = new JButton("Print");
            printButton.addActionListener(new HelloWorldPrinter());
            f.add("Center", printButton);
            f.pack();
            f.setVisible(true);
    }

    Hello Sabre,
    thank you for testing. Of course it's good news that you don't see any overprinting, but unfortunately that doesn't help me on my site (Win7 64-Bit, java 1.7.0_09).
    Since I can see the character in my original application as I wrote, I made up the following test case and met a strange behaviour. I can make my desired unicode character appear without any overprinting as long as I don't use any other character in the string below 2000(16).
    Kindly run the following code. It prints a line of unicode characters starting with my desired one.
    Then change iConstant in makeTextLine() to any value below 0x2000. At my site this results in overprinting.
    Does it also happen at yours?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    public class UnicodeTest extends JFrame implements Printable {
      String text= "Test line with unicode \u2259 character.";
      public UnicodeTest() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(350, 200);
        text= makeTextLine();
        JLabel lb= new JLabel("<html>Printing started...<br>"+text);
        add(lb);
        setVisible(true);
        PrinterJob printerJob= PrinterJob.getPrinterJob();
        printerJob.setPrintable(this);
        try {
          printerJob.print();
        catch (PrinterException e) {
          System.out.println("PrinterException: "+e);
      public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
         new UnicodeTest();
      public String makeTextLine() {
        StringBuilder sb= new StringBuilder();
        int iStartValue= 0x2259;
        int iConstant= 0x2020; // Tested with 0x100, 200, 400, 800, 1000, 2000.
        for (int i=iStartValue; i<iStartValue+30; i++) {
          sb.append((char)i);
          sb.append((char)iConstant);
        return sb.toString();
      public int print(Graphics g, PageFormat pf, int page) throws
                                                            PrinterException {
        if (page > 0) return NO_SUCH_PAGE;
        Graphics2D g2d = (Graphics2D)g;
        g2d.translate(pf.getImageableX(), pf.getImageableY());
        g2d.setFont(new Font("Dialog", Font.PLAIN, 12));
        g.drawString(text, 50, 40);
        return PAGE_EXISTS;
    }

  • [svn:bz-trunk] 18060: tomcat-users. xml had an invalid Unicode character in the last commit

    Revision: 18060
    Revision: 18060
    Author:   [email protected]
    Date:     2010-10-07 06:40:08 -0700 (Thu, 07 Oct 2010)
    Log Message:
    tomcat-users.xml had an invalid Unicode character in the last commit
    Modified Paths:
        blazeds/trunk/servers/apache-tomcat-6.0.29/conf/tomcat-users.xml

    Mugunthan
    Yes we have applied 11i.AZ.H.2. I am getting several errors still that we trying to resolve
    One of them is
    ===========>>>
    Uploading snapshot to central instance failed, with 3 different messages
    Error: An invalid status '-1' was passed to fnd_concurrent.set_completion_status. The valid statuses are: 'NORMAL', 'WARNING', 'ERROR'FND     at oracle.apps.az.r12.util.XmlTransmorpher.<init>(XmlTransmorpher.java:301)
         at oracle.apps.az.r12.extractor.cpserver.APIExtractor.insertGenericSelectionSet(APIExtractor.java:231)
    please assist.
    regards
    girish

  • Unicode Character Map

    Hi-ya
    I want to craate a unicode character map much like the one in windows. You choose a font and it shows you all the characters.
    First of all I would have thought this would exist, either with swing or java but I can't find it. Has anyone seen one in the wild?
    Secondly how would the iteration alogrithmn look like?
    I found some samples at unicode.org but they seem way oversized for what I want to do. This is the applet from unicode that I am talking about:
    http://www.unicode.org/reports/tr15/Normalizer.html
    Is there no easy - peasy way to go through all the unicode code points in a font? Like I said either in swt or swing.
    thanks.

    You haven't seen the Font2DTest demo program?
    It doesn't seem to be online but you will find if you look under the demo/jfc/Font2DTest directory of your copy of the java virtual machine.

  • Arabic Unicode Character

    Dear Sirs,
    Could anyone please help me how I could convert Unicode Character to Arabic and then display on the console (Windows XP).
    For example
    String alif = "\u0625";
    System.out.println( alif );
    ONLY PRINTS ( Question Mar) ?
    Thanks in advance

    Thanks a lot.
    I beleive that the proper answer was to inform me that this is not java related and it windows O/S related.
    IF I WOULD HAVE KNOWN, TRULY AND SINCERLY, THAT THIS IS NOT JAVA RELATED I WOULD NOT HAVE COME TO THE JAVA FORUM AND ASK SUCH QUESTION.
    I HAVE TESTED OTHER UNICODE CHARACTERS REGARDING OTHER LANGUAGES AND IT DISPLAYED PROPERLY. I ASKED MY SELF THERE MIGHT BE SOMETHING WRONG WITH MY CODE.
    THAT IS WHY I CAME TO THE JAVA FORUM AND ASKED MY QUERY.
    When I have checked the forum search, after your reply, I have seen that many people asked similar questions.
    Any way thanks a lot for your help and GOD BLESS.

  • Testing New Unicode Character (Music Symbol)

    I am trying to test the new Unicode character by using J2SE1.5.
    For example, If I wanted to test the music symbol "1D15F", how do we test that or how do we write code?
    The following is my code.
    import java.text.*;
    import java.util.*;
    import java.lang.Character.*;
    public class NewUnicodeCharacterTest {
    public static void main (String[] args) {
    String quarternote = "\u1D15F";
    System.out.println (quarternote);
    my output was
    What is wrong?

    Looking at the Java 1.5 API, I figured out that you should be able to create a string with UTF-32 code points by specifying an int[]:
    String s = new String(new int[] { 0x1D15F }, 0, 1);
    Note that System.out.println() will fail unless your console supports a codepage which contains the symbol in question. You can work around this by drawing your string onto a swing component. I tried this (using the J2SE 1.5 alpha, not beta), but I couldn't get the quarter note symbol -- maybe it's not supported in the font.

  • Need suggestion on Multi currency and Unicode character set use in ABAP

    Hi All,
    Need suggestion. In one of the requirement I saw 'multi-currency and Unicode character set experience in FICO'.
    Can you please elaborate me how ABAPers are invlolved in multi currency as I think this is FICO fuctional area.
    And also what is Unicode character set exp.? Please give me some document of you have any.
    Thanks
    Sreedevi
    Moderator message - This isn't the place to prepare for interviews - thread locked
    Edited by: Rob Burbank on Sep 17, 2009 4:45 PM

    Use the default parser.
    By default, WebLogic Server is configured to use the default parser and transformer to parse and transform XML documents. The default parser and transformer are those included in the JDK 5.0.
    The built-in WebLogic Server DOM factory implementation class is com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.
    The DocumentBuilderFactory.newInstance method returns the built-in parser.
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

  • Unicode Character sets (e.g UTF-8)

    Hi,
    We are using some third party software which will connect to the oracle database.
    One of the requiremebnts it states is that both the databse client and server must use the Unicode character set e.g UTF-8.
    How do we ensure this when installing the oracle client software.
    Also, why when install orcale client software and select language as English does it put NLS_LANG as American by default.
    Is there an English U.K language option - couldn't see it.
    Many Thanks

    user5716448 wrote:
    Hi,
    We are using some third party software which will connect to the oracle database.
    One of the requiremebnts it states is that both the databse client and server must use the Unicode character set e.g UTF-8.
    Pl post details of OS and database and client versions being installed
    How do we ensure this when installing the oracle client software.
    For the client, set NLS_LANG appropriately when using the client software - there is no setup required during the install - http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html
    Also, why when install orcale client software and select language as English does it put NLS_LANG as American by default.
    Is there an English U.K language option - couldn't see it.Try "ENGLISH"
    http://docs.oracle.com/cd/E11882_01/server.112/e10729/ch3globenv.htm
    >
    Many ThanksHTH
    Srini

Maybe you are looking for