Printing in Unicode environments

Hi All -
Can anyone give me any guidance on printers after Unicode conversion?  I'm concerned that I might be missing something - there are steps in the Unicode conversion guide as to how to handle old spool requiests, but there is no information if we need to update anything with our printers in order for them to work correctly once we have converted our ECC 6.0 system to Unicode.  I'm trying to err on the side of caution, so I appreciate the help!
Thanks -
Abby

Hi Abby,
in general the printing mechanism does not change in a Unicode system.
In a Non-Unicode system, the data is converted from e.g. code page 1100 (Western European code page) to the printer code page (assigned to the device type - e.g. 1116 for device type HPLJ4).
Now if you convert the system to Unicode, the data is converted from Unicode (SAP code page 4102 or 4103) to the printer code page assigned to the device type.
Hence the system takes care of the proper code page conversion.
However in some rare cases (e.g. if you created your own device types with Non-latin-1 data), there could be issues.
Therefore you should test your printer landscape as part of the Unicode conversion project.
This is especially valid for printing forms developed with a Non-Latin language (like Chinese), as in this case you can have issues with shiftings and used fonts.
But there is no known specific effort to be planned in a Unicode conversion for the adaptation of the printers (like UCCHECK).
Best regards,
Nils Buerckel
SAP AG

Similar Messages

  • Incorrect printing of Unicode characters

    C5180 prints some unicode chars (0x2283 and 0x25A1) as if combined with a carriage return.
    On screen the line looks fine, but on my printer they are printed at the beginning of that (current) line.
    I use them in a Java program and don't see where the error lies: Windows 7, Java 7 or HP. (3 changes in one)

    Hi,
    It is a printer issue. The printer needs to be configured to support the Chinese chanracter set.
    Normally when we are able to view the chinese characters properly in the print preview but not properly displayed on the output it is surely a printer problem.
    This kind of problem we faced many times.
    Thanks
    Ram

  • QRcode printing with unicode characters

    Hi,
    We're trying to print out QRcode in smartforms by referencing below link with output device ZBWIPP and device type ZBWIPPQR.
    http://www.rjruss.info/2010/09/how-to-printpdf-qr-codes-in-standard.html
    Meanwhile, we need to print out trad. Chinese in same smartform.
    Seems that QRcode and trad. Chinese are in different character set.
    Would there be any device type which supports QRcode and unicode ?
    or any revision requires for ZBWIPPQR device type?
    Please help.
    Thank you.

    Hello Nieves,
    Just came aware of your question and see its been a while so you may have moved on.
    However I created the post you refer to.
    Also I posted the following SCN blog post that covers using a Japanese Device type to allow Kanji with the QRcode.
    The SAP note referenced in the blog also has Chinese device types so could be adapted. The device types do come with some limitations so may not be suitable in all cases.
    If you still have the requirement have a read of my SCN blog and happy to help further if required.
    Cheers
    Robert
    Barcodes in SAP with the Barcode Writer in Pure Postscript update

  • Which device type support Unicode printing ?

    Hi all,
    Do you know which cascading font device types support Customer-defined true type fonts ?
    I use HP LaserJet printer. I've imported ZSWINCF device type in to SAP system and installed some true type fonts required for my report. It's able to print <b>Unicode </b>text in ABAP List but unable in SAPScript/Smartform printing.
    I also try to use ZHPUTF8 or HPUTF8, and install these fonts. But i've problem in printing out.
    Do you know how to resolve this problem ?
    Thanks,
    Best regards,

    Hi
    see this OSS notes may be useful
    OSSNote:960341
    Symptom
    In some device types (e.g HPLJ4, HPLJ5) you experience non-uniform character spacing in the PDF document after the PDF conversion of SAPscript or Smart Forms documents, using HELVE or TIMES fonts. You want to know the reason.
    Other terms
    CONVERT_OTF, SAPscript, Smart Forms
    Reason and Prerequisites
    The problem is not due to an error in the PDF converter but due to the fact, that the printer font, underlying the device type (e.g. Univers or CG Times in PCL-5 device types), is not available for the PDF converter and is either not available in Adobe Reader. The PDF converter has to try to simulate the layout of the printer font by means of a font which is predefined in Adobe Reader. This is done by assigning the letter widths of the printer font to the font used in Adobe Reader.
    The PDF file contains a table with letter widths, used by Adobe Reader in the output of text, for each used printer font (except PostScript fonts).
    Example:
    %Charwidth values from HP4300 HELVE 060 normal
    /Widths
    [ 278 333 500 633 633 1000 758 333 333 333 633...
    Adobe reader converts this width table, by modifying the space between each character, so that the specified letter width (= space between the current and the next letter) is kept.
    This 'Simulation' of printer fonts results in the sometimes visible irregular spaces in PDF.
    The PDF converter always uses the Helvetica Adobe PostScript font for the display of HELVE and the Times Roman Adobe PostScript font for the display of TIMES. However, for these Adobe PostScript fonts, Adobe Reader often uses a Windows TrueType font, which differs slightly from the original PostScript font.
    Solution
    Workaround: Use the POST2 PostScript device type or the PDF1 PDF device type for the PDF conversion of documents in the Latin-1 character set. They both use the Adobe PostScript fonts Helvetica or Times Roman for the HELVE/TIMES printer fonts.
    Header Data
    Release Status: Released for Customer
    Released on: 30.06.2006  12:44:06
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: BC-CCM-PRN Print and Output Management
    Secondary Components: BC-SRV-SCR SAPscript
    OSS Note: 776507
    Symptom
    Documents printed via SAPscript or SmartForms do not print with correct special characters, e.g. ### prints instead of Japanese or Russian characters. What to do?
    Other terms
    SAPscript, SmartForms, printing, device types, OTF
    Reason and Prerequisites
    Help required to choose proper fonts in a SAPscript or SmartForm
    Solution
    When using SAPscript or SmartForms to print (or email or fax) a form from a business application, many factors influence the outcome of the actual text within the form. All these factors must be checked in order to ensure a correct printout:
    1) The language version of the form used to produce the printout.
    Example: If you want to print a French invoice, you need to have a FR version of your SAPscript or SmartForms invoice form RVINVOICE01. And the application program must specify the corresponding language key (FR) when calling the SAPscript or SmartForms API.
    2) The font selections specified in the form (possibly also in a SAPscript style or SmartStyle used in a form).
    Example: In a SAPscript form or a SmartStyle you need to specify HELVE if you want to print German text in Helvetica (or similar) font. If you want to print Japanese text, HELVE is not a valid choice but you need to specify a Japanese font like JPMINCHO in your Japanese form.
    3) The output character set of the device type
    Every printer in transaction SPAD has a "device type" assigned. Device types used by the spooler for printing support only one single specific output character set. All text from the form has to be converted (using SAP's built-in character conversion mechanism) to this output character set.
    A character set can typically support either a single language (e.g. Shift-JIS which supports only Japanese) or a set of languages (e.g. ISO 8859-1, which supports Western-European languages). It is possible that a given language (such as German) can be supported by several output character sets, e.g. you may use either ISO 8895-1 (Latin-1) or ISO 8859-2 (Latin-2) to represent German text. This is so because both character sets contain the special characters used in German.
    Example: HPLJ4000 is a HP LaserJet device type supporting the ISO 8859-1 (Latin-1) character set. ISO 8859-1 can be used to represent e.g. Dutch, English, French, German, Spanish, Swedish but NOT Russian or Japanese.
    As a consequence, it is ok to use HPLJ4000 to print English, German French etc. but not for Japanese or Russian.
    4) The set of available printer fonts for a given device type
    When formatting a document, SAPscript and SmartForms perform an automatic mapping of the font definitions in the form (e.g. "HELVE 14 point bold") and the available printer fonts of the device type. A replacement printer font is chosen, should the specified font selection not be available in the device type. Now this replacement can be problematic if a language-specific font, such as Chinese CNSONG, is specified in a form and it gets replaced by a font which does not support this language, e.g. COURIER.
    To solve this problem, font families in SE73 have language attribute assigned, e.g. some fonts are characterized as being suitable only for certain languages. And when a replacement has to be chosen because the original font from the form is not available in the device type, a replacement font is chosen which has the same language attributes.
    If no fonts for the language in question exist in the device type, the resulting font will not be able to print the special characters and you will see "wrong" output characters in the printout.
    Note on SAPscript/SmartForms Print Preview:
    The OTF Print Preview available in Windows GUI (e.g. from transaction SP01) will sometimes not show the "wrong" characters which appear on the final printout. Here is the reason: since the Print Preview runs in Windows environment, it will use Windows fonts to represent the actual printer fonts. A Windows font typically has more available characters (i.e. covers more character sets) than are actually available in a printer's resident font.
    A typical example where the Print Preview will differ from the printout is here: if you have a Chinese PCL5 printer such as CNHPLJ4 and use the Western Latin font COURIER in your document, the print preview will show you Chinese characters if you (by accident) tried to format Chinese characters in COURIER font. This is because Windows will automatically choose a font that can output Chinese characters (which is actually not Courier). But when you print the job on an actual PCL5 printer with resident Western and Chinese fonts, the Courier font will not print any Chinese characters but Western special characters instead, because the printer's resident Courier font does not include Chinese characters.
    Rule of thumb: all Asian device types (e.g. CNHPLJ4, JPHPLJ4, JPPOST, KPHPLJ4) support not only Asian fonts but also COURIER, HELVE and TIMES fonts. But these Latin fonts can only be used to print English text, not Chinese/Japanese/Korean characters.
    Which fonts are suitable for a given language?
    Language(s):            Font family to use in a form:
    Latin-1 (Western Europe/Americas) *******
    DE,EN,FR,ES,NL,SV       COURIER, HELVE, TIMES
                            (LETGOTH, LNPRINT)
    Latin-2 (Central Europe) ****************
    PL, CZ                  COURIER, HELVE, TIMES
    ISO 8859-4 (Baltic) *********************
    ET, LT, LV              COURIER, HELVE, TIMES
    ISO 8859-5 (Cyrillic) *******************
    BG, RU, SR, UK          COURCYR, HELVCYR, TIMECYR
    ISO 8859-7 (Greek) **********************
    EL                      COUR_I7, HELV_I7, TIME_I7
    ISO 8859-8 (Hebrew) *********************
    HE                      COURIER, HELVE, TIMES
    ISO 8859-9 (Turkish) ********************
    TR                      COURIER, HELVE, TIMES
    Simplified Chinese **********************
    ZH                      CNHEI, CNKAI, CNSONG
    Japanese ********************************
    JA                      JPMINCHO, DBMINCHO, DBGOTHIC
    Korean **********************************
    KP                      KPBATANG, KPDODUM, KPGULIM
                            KPGUNGSE, KPSAMMUL
    Traditional Chinese *********************
    ZF                      TWDPHEI, TWMING, TWSONG
    Thai ************************************
    TH                      THANGSAN, THDRAFT, THVIJIT
    Arabic (Unicode systems only) ***********
    AR                      ANDALE_J
    Verify your output by examining the OTF data
    When analysing printing problems of this type, be sure to check the OTF data which gets produced by SAPscript or SmartForms. OTF or "Output Text Format" is the intermediate page-description format generated from SAPscript or SmartForms. OTF will contain the final printer font names and character set/language identifiers which help to solve the problem. OTF will even name the form and the language of the form used to create the output.
    The easiest way to do this is to create a spool request from your application, run transaction SP01, use menu
    Goto->Display Requests->Settings
    and choose
    Display Mode: Raw
    Now display your spool request. If this is a SAPscript or SmartForms spool request, you will see OTF data. Each line represents one OTF command, every command starts with a 2-character cmd identifier and possibly some cmd parameters follow.
    Here is an excerpt from a sample OTF file where we highlight the most interesting commands:
    //XHPLJ8000    0700 00000000001
    IN04EALEXTEST_ZEBRA
    IN05%PAGE1
    OPDINA4  P 144  240 1683811906000010000100001
    IN06%WINDOW2
    MT0024401289
    CP11000000E
    FCHELVE  120  00109XSF100SF101110000067E X
    UL +0000000000000
    SW00067
    CT00000000
    ST0453037Dieses SF hat Stil ALEXTEST_ZEBRA mit
    The 1st line with the // (Control) command reveals the device type usedto print: HPLJ8000
    //XHPLJ8000    0700 00000000001
    The 2nd line (IN = Info command) shows the name and (internal 1-char)language key of the form:
    IN04EALEXTEST_ZEBRA
    In this case it is the English (E = EN) SmartForm ALEXTEST_ZEBRA
    The OP-line (OP = Open Page) gives the page format used in the form, it is DINA4 Portrait orientation:
    OPDINA4  P 144  240 1683811906000010000100001
    The CP (CodePage) cmd shows the SAP system codepage used to code the text and the active language. In our case it is codepage 1100 and language E = EN = English.
    CP11000000E
    Finally, the FC-cmd (Font Call) lists a printer font selected within SmartForms. Please note that every SmartForm has a designated default SmartStyle under "Form Attributes->Output Options". In addition, every text node can have a SmartStyle attached (which will override the definitions from the default style for the text). In our case the resulting printer font that was selected is HELVE 12.0 pt bold-off, italic-off.
    FCHELVE   120  00109XSF100SF101110000067E X
    Header Data
    Release Status: Released for Customer
    Released on: 22.08.2005  09:57:20
    Priority: Recommendations/additional info
    Category: Customizing
    Primary Component: BC-CCM-PRN Print and Output Management
    Secondary Components: BC-SRV-SCR SAPscript
    BC-SRV-SSF Smart Forms
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Unicode Printing in ABAP program

    Hi all,
    I have a problem in Unicode printing. When I write a report, I use Unicode font. Everything is Ok when I print preview this report. But when i send it to the printer, the unicode font doesn't present.
    Do you know how to solve this problem ?
    Thank you very much.
    Sylvecast.

    Hi Atish,
    Yes, of course. I can print any word document with unicode font. I don't know if there must have any settings in ABAP program ? But when i print preview it, evrey thing is OK.
    Kindly regards,
    Sylvecast.

  • Printing unicode characters in Java - help

    Hi there,
    I want to print out unicode characters through java programming language in windows system. For example, I want to print Devanagari characters. I found out that '\u0900' to '\u0975' represent devanagari characters. So I tried following,
    out = new PrintStream(System.out, true, "UTF-8");
    out.println('\u0911');
    but they print characters like ��� and not the actual devanagari characters. Just to be more clear, devanagari script is used by Hindi, Nepali and similar languages.
    If you knew about it and could give any suggestions, that would be very helpful.
    Thanks in advance!

    priyankabhar wrote:
    I am not sure, it is just a windows system and I am trying to print to the command line. Please suggest me how I can find out if my console supports it.Use the CHCP command to find out what code page your console uses. And as already suggested, Google is a good resource if you don't know what a "code page" is.

  • Printing Unicode characters

    Hi all,
    I am trying to print certain unicode characters to a file using this code:
    import java.io.*;
    public class Unicode{
         public static void main(String args[]) throws IOException{
              char[] c = new char[1];
              char ch= '\u0ce6'; //starting character
              File f = new File("c:\\UC.txt");
              BufferedWriter bf = new BufferedWriter(new FileWriter(f));
              while( ch < '\u0cef'){
                   c[0] = ch++;
                   bf.write(c, 0, 1);//write the character to a file
              bf.flush();
    }All I can see in the file is '?????????'. I tried printing it to file as command prompt also showed the same thing. How can I see the Unicode characters of different languages? Do I need to set any char encoding using System properties?
    Thank you very much.

    Sigh there is no such thing as plain text.
    You create a file with the platform encoding (read the API docu of the FileWriter). That platform encoding is probably not even able to represent all unicode characters (it's likely to be ISO-8859-1 or one of it's variants).
    Then you open that file without specifying the character set (it's guessed, possibly wrong) and you don't see the expected output.
    Read http://www.joelonsoftware.com/articles/Unicode.html for an introduction into the beautiful world of unicode.

  • Bug when printing unicode

    I try to print some unicode character. The browser display it well, but when printing it show some square like when the unicode is not found.
    For instance try http://getbootstrap.com/components/. Unicode is well displayed in the browser, but when I print (In a .xps file or with a printer) it is not. On the first page (only the first page is required to highlight the bug), the "glyphicon-glass" is the first to fail.

    It seems that I had an older version. I update to 24.6.0 on ESR and the trouble is gone.

  • Crystal report printing using epson dot matrix printer (continouos paper)

    Hi there, im tiff from the philippines.
    i have a  question on printing using a crystal report. How do i print using epson continuous printer(dot matrix)? im having a problem printing to that type of printer specially using continuous paper. the first page is correct but unfortunately the succeeding pages are not. its automatically adjusted upon reaching the second page. hope you can help me.
    thanks a lot and looking forward to hear from you soon.
    tiff

    Check with the printer manufacturer that the matrix printer is Unicode compliant. If it is not, it will  not work with Crystal Reports. If it is, make sure you have the latest printer driver updates.
    Download SP 1 for CR 102 from here;
    https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
    See the following resources re. printers;
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a09051e9-721e-2b10-11b6-f9c65c64ef29
    [Note #1314394|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    Ludek

  • Standard text displayed correctly in print preview but not in print

    Hi,
    I have a script in which a standard text has to be printed in the output.
    The standard text contains some german characters.
    These characters are displayed correctly in print preview but not in print.
    The text is maintained in 3 languages DE,EN and Russian.
    The same text is being printed in some standard report. But that is displayed correctly both in print and print preview.
    Please suggest something.
    Regards,
    Richa Aggarwal

    Hi Richa,
    Check this document from SAP: [help doc|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0652a95-5f0b-2a10-5aba-c085f8bbe6d6?QuickLink=index&overridelayout=true]
    It indicates that you have to be sure to select "Unicode" fonts for your SAPScript form to ensure the proper printing of "Unicode" characters.  If a character does not display then that means it does not exist in the font that you are using.
    Regards,
    Ryan Crosby

  • Adobe Reader Won't Print (ver. 10 or 11)

    I have a well-maintained Windows 7 32 bit machine running in a VMWare Workstation virtual machine that prints to a network printer via TCP/IP.
    It has worked well for years, including printing PDF's from Adobe Reader 9.
    Some time ago I updated Reader to version 10.  Printing stopped working.  Eventually I uninstalled Reader 10, and re-installed Reader 9, and printing then worked normally.
    I decided to try to update to the latest Reader version 11 (downloaded today) and had the same results:  the installation completed without error, I can open and view documents fine, but printing does not work.
    When I attempt to print from Reader, I see the appropriate dialog boxes, and receive no error messages.  The print job just never makes it to the printer (or the Windows print quque).
    I uninstalled Reader 11, and re-installed Reader 9 once again...and again printing now works fine.
    I guess I will continue to use Reader 9...but I would like to get to the bottom of the printing problem so that I can eventually update Reader.
    FYI the printer in question is a Lexmark C544dn, and I am printing to it via ethernet.  I have alread removed the printer from WIndows, and re-installed with latest drivers (at least twice), with no change:  printing still does not work.
    Any suggestions on causes or possible resolutions?

    Thank you for providing the suggestion and the Cleanup tools, however they did not help.
    I ran each version of the cleanup tool, and for each I had it clean up Reader and Acrobat (i.e. 4 separate cleanup operations).  I then rebooted the machine, and installed Reader 11.0.3.
    Still had the same behavior:  Reader will not print.  I tried printing to a second printer (that is attached via USB)...and it did not work either.  I also tried printing to a Cute PDF Writer print driver...and that did not work either.  In each case, no print data made it to the Windows print queue (as demonstrated by watching the queue while printing.)  No error was raised, but no print data was transmitted.
    I then uninstalled Reader 11.0.3, rebooted, and re-installed Reader 9:  printing works fine now.
    There is definitely something in Reader 10 and Reader 11 that breaks printing in some environments.    (As you alluded to...I have seen a number of postings online about printing problems in Reader.)
    More details about my environment:
    Windows 7 Professional N (Version 6.1, Build 7601: Service Pack 1)
    VMWare virtual machine
    Two virtual CPUs (each: Intel Core i7 920 @ 2.67 GHz, 2673 Mhz, 1 core, 1 Logicial Processor)
    Hardware Abstraction Layer:  6.1.7601.17514
    RAM:  3096 (allocated to virtual machine)
    Bridged networking
    VMware host:
    Windows 7 Ultimate, 64-bit 6.1.7601, Service Pack 1
    18 Gig RAM
    Intel Core i7 CPU 920 @2.67 GHz
    VMWare Workstation 9.0.2 build-1031769
    (but problem existed on older version of VMWare Workstation 7.x as well)

  • Problem with Printing Japanese

    Hi Experts,
    We have a Unicode enable Printer (I tried Printing Japanese Characters and others it works) and also SAP Unicode System
    I tried the following steps but it still doesnu2019t work, do I missed some configs?  I have read that I must used True Type Font how to change to that font?
    -     Try to check if the Printer supports Unicode to print Japanese Characters
    I tried printing using MS Word copying Japanese, Greek and Russian letters to check if it is supported and yes it is printed correctly, the Printer does support Japanese and other characters
    -     Try to have a Japanese logon setting in transaction SU3
    I tried to change this settings but it still doesnu2019t work
    -     Try to change the character set to Japanese
    I tried to change this setting in SPAD but still it doesnu2019t work
    -     Try to use JSAPWIN driver for the printer in transaction code SPAD in SAP
    I tried to change to use this driver but still it doesnu2019t work
    -     Try to use ALL the possible combinations for Driver and Character Set for Japanese Character
    I tried to use ALL the combinations one by one using Japanese settings but still it doesnu2019t work, I even tried the setting for UTF 8 (encoding for Japanese Characters) and Unicode settings but still it doesnu2019t work
    BR;
    LBJ23

    Hi,
    Ok for report testing purpose try doing this for your simple ABAP program you created.
    Execute the program.
    Then click on utilities->more utilities-->upload/download.
    Choose download and select the desktop or where you want to save your filename.Give some name for the filename where you want to save the data.The option below filename is codepage where codepage is set to default.
    If you save it as it is this problem will come but if you change the codepage to the number I told or some other value relevant to Japanese in the file you can see the characters in Japanese.
    So its codepage problem only.
    For the VF03 I will look into it and let you know tommorow.
    Regards,
    Subhashini

  • Html numeric entity to unicode

    The html numeric entity "&#163" (the Pound sign) is equivalent to \u00A3.
    Given "&#163", how do I get its unicode?
    Thanks

    If I remove this invalid xml character before doing xml parsing, it could avoid the exception.
    How do I make my program treats "& # 3 ;" (again please remove the space) as a single character(or unicode).The problem is that XML does not permit most of the ASCII non-printing characters -- Unicode code points 0 .. 31, so the parser is correctly rejecting it. Unfortunately, there are a lot of XML output tools -- including the one in the Sun JDK -- that simply escape these characters.
    The solution is that you're going to have to pre-process the input, search for all occurrences of the invalid character, and remove it before the XML parser touches the file.

  • Non-Unicode Support Post NetWeaver 2004s

    Hi everyone,
    Our site runs an existing non-unicode environment, and are aware that we can definetly upgrade our existing environments to NetWeaver 2004s (Basis 7.0).
    However will SAP provide future upgrade kits for later releases of SAP (eg Basis 8.x and higher) for non-unicode environments.
    Cheers
    Shaun

    Thanks Matt and Eddy for your replies.
    I had already read the "blog" Matt, and Eddy I have spent a heap of time in the service market place reading everything thats available on unicode including oss notes.
    However here is a snippit from the blog the Matt directed me too:
    ========================================================
    2. This change only really effects NEW installations of SAP NetWeaver and SAP applications based on SAP NetWeaver that were previously available with non-Unicode installation options.
    3. Existing installations of SAP NetWeaver and SAP applications based on SAP NetWeaver that were based on single code pages can be upgraded to the new releases WITHOUT having to convert to Unicode. This is really cool as it protects your existing investments and you can live in the non Unicode world for a <b>little longer</b>.
    ========================================================
    Note on "3." that is says at the end there "for a little longer". ... how long?  too what release?
    From what I have read so far it sounds like anything above NetWeaver Application Server 7.0 will require a unicode conversion.
    Any comments??
    Ideally I would like someone to just give me a yes/no answer.
    Cheers
    Shaun

  • Why unicode symbol (copyright) in textfield to drawString not interpreted?

    I have a textfield that I can type stuff into and have printed on a JPanel. However, when I type in some unicode, it's printed as the code not what it means. Why is this? how do I fix this?
    NOTE: to try this sample program, you have to type "\u00a9" (without the quotes) into the text box and then click the button.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestSymbol extends JPanel
         private static JTextField field;
         public void paintComponent(Graphics g)
              //This prints a copyright symbol
              g.drawString( "\u00a9 Something", 50, 50 );
              //This prints the unicode
              g.drawString( field.getText(), 50, 100 );
         public static void main(String[] args)
              JFrame f = new JFrame();
              f.setSize( 500, 500 );
              JPanel p = new JPanel();
              p.setLayout( new FlowLayout() );
              //The panel that prints everything
              final TestSymbol t = new TestSymbol();
              setExactSize( t, 200, 200 );
              p.add( t );
              //The text field
              field = new JTextField( "", 10 );
              field.setSize( 100, 25 );
              p.add( field );
              JButton button = new JButton( "click" );
              button.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        t.repaint();
              p.add( button );
              f.getContentPane().add( p );
              f.setVisible( true );
         private static void setExactSize(JComponent component, int width, int height)
              Dimension dim = new Dimension( width, height );
              component.setPreferredSize( dim );
              component.setMaximumSize( dim );
              component.setMinimumSize( dim );
              component.setSize( width, height );
    }

    sabre150 wrote:
    Unicode representation as String literals are parsed by the compiler. Unicode representation entered by the user has to be parsed by your program and should substitute the unicode string for the appropriate unicode value. See reply #1 of http://forums.sun.com/thread.jspa?threadID=5226995&tstart=28049 .
    Edited by: sabre150 on May 14, 2009 5:26 PMThanks! I just figured that out too.
    This isn't the best, but it properly converts all unicode within a string from a text field (you can add it to my previous program):
         private static String UNICODE_START      = "\\u";
         private static int UNICODE_LENGTH      = 6;
         private static String convertUnicode(String base)
              //Unicode unicodePos
              int unicodePos = 0;
              int currSpot = 0;
              //String length
              int length = base.length();
              //Our return string
              StringBuffer buffer = new StringBuffer( length );
              //Loop and convert
              while ( ( unicodePos = base.indexOf( UNICODE_START, unicodePos ) ) != -1 )
                   //The unicode string
                   String unicode = base.substring( unicodePos, unicodePos + 6 );
                   //Is actually a unicode character
                   if ( isUnicode( unicode ) )
                        //Put everything up to this into the buffer
                        if ( currSpot < unicodePos ) buffer.append( base.substring( currSpot, unicodePos ) );
                        //Now append our new character
                        buffer.append( ( char ) Integer.parseInt( unicode.substring( 2 ), 16 ) );
                        //Move to end of this unicode
                        unicodePos += UNICODE_LENGTH - 1;
                   //Move forward
                   unicodePos++;
                   currSpot = unicodePos;
              //Put in everything left
              if ( currSpot < length )
                   buffer.append( base.substring( currSpot ) );
              return buffer.toString();
         private static boolean isUnicode(String unicode)
              //Check length
              if ( unicode.length() != UNICODE_LENGTH ) return false;
              //Make sure it starts with unicode start
              if ( unicode.indexOf( UNICODE_START ) != 0 ) return false;
              try
                   //Can only have hex symbols
                   Integer.parseInt( unicode.substring( 2 ), 16 );
              catch (NumberFormatException e)
                   return false;
              return true;
         }

Maybe you are looking for