Chinese characters in JDialog title?

Hi all,
I'm running the JDK on an english language machine, but starting a program with the command line prompt -Duser.language=zh to display Chinese characters.
If I have some chinese characters in a JDialog title, or a JOptionPane message or title, the characters are replaced with boxes. I can see Chinese characters everywhere else, in JLabels, text boxes, JTrees, etc, so its not a problem with fonts.
Has anybody else had this problem? Is there a work around for this? Is it something to do with the UIManager setting the fonts for JOptionPane's?
thanks,
Justin

Try calling these at the start of your app before showing any windows:
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
If that doesn't work, I don't know what would. The default is that the OS draws the frame titlebar, and on English systems, it's not going to display chars that aren't in the charset. I'm sure you could change that by installing other charsets, but you can't really do that on other people's machines.

Similar Messages

  • Using chinese characters/font in titles

    I am trying to use Chinese characters for subtitles in my video and a few of the characters turn into boxes?  I am a Mac user and have the proper Chinese keyboard selected.... which works fine in Word.  Please help!!!  I think there is something to do with the available fonts in premiere pro, something about the font being unicode vs. non-unicode.

    Try creating these in Photoshop, then import the PSDs into PP.

  • The "blue bar" no longer properly displays Chinese characters.

    I recently updated my Adobe Reader from 7 to 9.4, and since doing so, Firefox no longer displays Chinese characters in the title bar. Instead, I now only see question marks.
    I've added Chinese to the preferred languages and also tried switching the browser's text to Unicode, but neither of these has made a difference.
    It's certainly a minor issue, but if anyone knows what to do, I'd greatly appreciate the help!
    Thanks!

    A possible cause is that Firefox has a problem with the (system) font that is used to display the Chinese characters on the title bar.
    Were any new fonts installed recently?
    You can try to use the system file checker to see if there are any problems with font files.
    See Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe): http://support.microsoft.com/kb/310747

  • Form conversion to PDF with Chinese characters

    Hello.
    I have a Sap script form and it has Chinese characters in the title and footer.  It is converted to PDF then send it to email, at transaction SOST. The Chinese characters was replaced by '#'.
    Our basis tried to install the device driver for PDF stated in sap note 999712, but still it didn't correct the form's output in the PDF file.  The form is in ZH and the font used in the form is CNSONG.  The transactions was also executed during ZH logon.  Would anybody know a solution to this?
    Thanks in advance!

    Doray,
    For printing in PDF other than english characters we have to create new font .
    Go to SE73 and create new font family Named ZCOUR_I6 and then execute the report RSTXPDF2 where in select the optin for activity to be performed as READ and SAVE the font file.
    From control panel for to fonts and copy the COURIER NEW (TrueTYpe) font on to ur desktop .
    Upload the the same font file using RSTXPDF2 by specifying it in the file name.
    Then try to execute the tcode which u r usingh for converting the output to PDF and check whether the desired output has been converted.
    Hope things are little clear for you.
    Regards..

  • My Title Bar is suddenly appearing in Chinese characters, what happened (and how do I fix it)?

    The title bar on my browser is now appearing with some type of chinese characters. Nothing else has changed, but I would like to know what happended, why, and how to return my system to normal

    That issue is caused by an extension (Tools > Add-ons > Extensions) and not by a plugin.
    If you see CJK (Chinese/Japanese) characters on the Firefox title bar or the Windows Taskbar then that can happen if Firefox switches to UTF-16 encoding for some reason.
    The ''RealPlayer Browser Record Plugin'' extension (Tools > Add-ons > Extensions) has been reported to cause that issue.
    Be sure not to get confused with the RealPlayer plugin (Tools > Add-ons > Plugins) that plays media files.
    The extension adds some extra features like saving media files.
    You can disable/remove the ''RealPlayer Browser Record Plugin'' extension in the RealPlayer Preferences (RealPlayer: Tools > Preferences > Download & Recording)
    See also [[Troubleshooting extensions and themes]]

  • Chinese Characters in JFrame Titlebar

    Hi, we have created a application, mainly intended for chinese users. Based on the user's choice the application will start up with the appropriate resource bundle. However, while using the chinese resource bundle, everything is working perfectly, except that the JFrame/JDialog titles are not showing the chinese characters. Can anyone please help me out on this?
    Thanx in advance,
    Regards,
    Debopam.

    From all the information I've read (since I had the same problem) the titles for JFrames can only be viewed in foreign characters when you're running on the foreign OS. A couple of people overcame it by writing their own Frame code, but if you're running on XP you can just install Microsoft's AppLocale (http://www.microsoft.com/globaldev/tools/apploc.mspx).

  • Is there a way to use proper mainland chinese characters on an ipad instead of the apple variants?

    I have been learning Chinese at University, and I bought an iPad to help my studies and I have found that Apple for the international keyboard has variants for many different chinese characters. Why is this and is there a way to use the chinese characters that 1.6 billn people use rather than the Apple variants? Will Apple be addressing this at all?

    No, The simple and traditional are fine, but when typing in simplified there choices for say, 将 or 骨 are different from both Simplified and Traditional entirely. If I had copied Apple's characters in tests I would have lost grades. I've never seen it happen on another operating system and unfortunatley Microsoft beats Apple in this field; hence why I call them Apple variants. I'm not the only one who has see this problem. The only way to get what I would call authentic chinese characters is with the method that is stated above. I found this solution in the thread titled "Chinese characters misrepresented". There are screen shots there too. I would love to find out how/why Apple chose this system for chinese.

  • How to use a select statement with chinese characters?

    I am currently developing a java servlet<using tomcat 4.x> which allows me to use select statement to retrieve results from the Microsoft SQL Server 2000 database. I am using a simple form to get the parameter for querying. The main problem i'm facing is that there are chinese information in the SQL database, but i can't retrieve it through the sql statement with the chinese characters input<thru the form with the help of NJ STAR>in the WHERE condition. When i execute the statement, it returns me no results even though the rows are present in the database.
    Does anyone have the solution to using chinese words in the WHERE clause of the select statement to retrieve results with columns which contains chinese characters? Please help me. Thanks everyone. :)
    PS: when i cut and paste those characters in the sql database and paste onto java.. it is ??? in questionmarks.. but when i paste them into excel 2000.. its shown as chinese chars again..
    please heelppp~~

    Greetings,
    PS: when i cut and paste those characters in thesql
    database and paste onto java.. it is ??? in
    questionmarks.. but when i paste them into excelThis is why the SELECT is not returning any results.
    You need to set the character encoding set on your
    statement and parameters for the characters to be
    properly translated. Refer to the charsetName
    parameter in the String class constructor in your API
    docs and also to
    $JDK_DOCS/guide/intl/encoding.doc.html in your JDK
    documentation.
    2000.. its shown as chinese chars again..Because Office programs are performing the same kind
    of character translation with the appropriate MS APIs.
    please heelppp~~Regards,
    Tony "Vee Schade" Cookis it possible for you to show me some coding examples? i don't really understand what is to be done in order to set the char set and what does it really do.. tried reading up but still dun understand.. :(
    pardon my shallow knowledge of java..
    ok..
    The thing is when i used an insert statement with chinese characters of GBK format hardcoded into the java servlet and then i use the insert statement to insert the chars into the database, it cannot be seen as a chinese word when i off the NJStar. and then it can be searched out with my current form of servlet.. below is my coding of the servlet..
    note: i've set my html file to charset = GBK
    //prototype of Search engine...
    //workable for GBK input and output...
    import java.io.*;
    import java.io.OutputStream;
    import java.io.IOException;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import java.util.*;
    import java.sql.*;
    import java.nio.charset.Charset;
    public class SearchBeta extends HttpServlet {
         private Vector musicDetails = new Vector();
         private String query = "";
         public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, UnsupportedEncodingException {
              query = req.getParameter ("T1");
              System.out.println("before:"+query);
              String type = req.getParameter ("D1");//type
              query = req.getParameter ("T1");
              //query = "������";
              System.out.println("after:"+query);
              getResults(type,query);
              System.out.println("locale = :"+req.getLocale());
              res.setContentType ("text/html;charset=GBK");
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<head>");
              out.println("<body bgcolor = \"black\">");
              out.println("<font face = \"comic sans ms\" color=\"Cornsilk\">");
              if (query.length()==0)
                   out.println ("Please key in your search query.");
              else if (musicDetails.size()==0)
                   out.println ("Sorry, no results matching your search can be found.");
              else {
                   out.println("<center>");
                   out.println("<table cellspacing = \"50\">");
                   int i = 0;
                   //Display the details of the music
                   while (i<musicDetails.size()) {
                        Results details = (Results)musicDetails.get(i);
                        String dbArtist = "";
                        String dbAlbum = "";
                        String dbTitle = "";
                        String dbCompany = "";
                        dbAlbum = details.getAlbum();
                        dbTitle = details.getTitle();
                        dbCompany = details.getCompany();
                        dbArtist = details.getArtist();
                        try{
                             dbAlbum = new String(dbAlbum.getBytes("ISO-8859-1"),"GBK");
                             dbTitle = new String(dbTitle.getBytes("ISO-8859-1"),"GBK");
                             dbCompany = new String(dbCompany.getBytes("ISO-8859-1"),"GBK");
                             dbArtist = new String(dbArtist.getBytes("ISO-8859-1"),"GBK");//correct translation.
                        catch(UnsupportedEncodingException e){
                             System.out.print(e);
                             e.printStackTrace();
                        String dbImage_loc = details.getImage();
                        out.println("<tr>");
                             out.println("<td><table>");
                                  out.println("<img src=C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\examples\\ThumbNails\\"+dbImage_loc+">");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Artist: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbArtist+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Title: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbTitle+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Company: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbCompany+"</font></td>");
                             out.println("</tr>");
                             System.out.println("album: "+ dbAlbum);
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Album: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbAlbum+"</font></td>");
                             out.println("</tr>");
                             System.out.println("company: "+ dbCompany);
                             out.println("</table></td>");
                        out.println("</tr>");
                        i++;
                   out.println("</table>");
                   out.println("</center>");
              out.println("</font>");
              out.println("</body>");
              out.println("</head>");
              out.println("</html>");
              out.close();
              //to remove all the elements from the Vector
              musicDetails.removeAllElements();
         //get Searched Music Details and store in Results object which is stored in musicDetails vector
         public void getResults (String type, String searchQuery) {
              try {
                   Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=music","sa","kokkeng");
                   Statement stmt = con.createStatement();
                   String query = "SELECT * FROM MusicDetails WHERE "+type+" = '"+searchQuery+"'";
                   ResultSet rs = stmt.executeQuery(query);
                   while (rs.next()) {
                        String artist = rs.getString("Artist");
                        String title = rs.getString("Song");
                        String company = rs.getString("Company");
                        String album = rs.getString("Album");
                        String image_loc = rs.getString("Image");
                        Results details = new Results (artist,title,company,album,image_loc);
                        musicDetails.add(details);
                   stmt.close();
                   con.close();
              catch (Exception e) {
                   System.out.println(e.getMessage());
                   e.printStackTrace();
    with the above servlet i created, i can search out the data in the database which i've inserted through the insert statement. I still can't search for things i've keyed into the database directly using NJStar..
    thank you so much for helping.. really hope any one else who knows the answer to this will reply too... thank you all so much...
    -KK

  • Chinese characters not shown correctly

    Hi there,
    I am having a problem with Chinese characters being correctly copied from a Word document into a Premiere Pro CS5 title. I am working with a Master Collection CS5 64-Bit on Windows 7.
    This is how the Chinese text  looks like in the Word document. Btw, the characters are correctly shown when being copied into Photoshop64bit. Just not when copied into my Premiere Pro title. So I guess my system has all the necessary tools available.
    操作1 – 预换模
    And this is how the text looks in my Premiere Pro title. Just that the two cubes are empty, only with the border.
    操作1 – &#127;&#127;模
    I couldn't find information on that in the help area.
    No matter what the Chinese means, I don't speak Chinese.
    Does anyone could give me a hint how to solve the problem? First choice recommendations warmly welcome :-) Only second choice would be creating a picture file and putting it in a videolayer. No good solution with many titles.
    Thank you!
    Oliver

    Oliver,
    The Titler is about the most font-sensitive program (or sub-program), that Adobe produces. It is more sensitive, than say Photoshop, Illustrator or InDesign, and those three programs are much more font-sensitive, than say a word processing program, like Word. It also needs for fonts to be 100% compatible, and not all are. Some will just not display in Titler, where they might in other programs.
    The first thing that I would look into is the exact Chinese font that you have. If there is not a perfect, compatible free font, that is very, very similar, then I would look into one of the larger foundries, and buy something that is very close.
    Another fix could be to just use Photoshop (you say that it handles the font properly), and create your Title there. Save that Image as a PSD, and Import that Still Image into PrPro to be used as a Title. With complex Titles, I often use a combo of PS and AI, and Save my creation as a PSD. PrPRo loves PSD's, and I have never had an issue.
    As a side-note on fonts, I have found quite a few, and many are popular ones, that just flat will not display in PS, AI, InDesign or Titler - many versions of Isabelle and Isabella (do not know why two fonts with such similar names would both be problematic?), just will not display. One gets strings of squares, where most other programs handle and display them perfectly. It's all about the exact font.
    Good luck,
    Hunt

  • Chinese Characters not displaying properly

    I pasted Chinese text into a Rolling title but not all of the characters display.  Some (not many) of them display as an x inside of a square.  All I can think is that some of the characters are not being recognized. If it matters, the text is simplified Chinese copied from a website, pasted into Notepad, then copied again and pasted into the title.
    Help is greatly appreciated.

    John,
    I see that now, but the font I selected (simsun) seems to have resolved my issue. I believe it is a bug if I can display the characters correctly on other app, especially Microsoft.  On Microsoft apps, I can select many standard fonts and the Chinese Characters display correctly.
    Thank you for the link to submit a bug report. When I get time I will submit it, and hopefully they will correct the issue. 
    God Bless,
    Mark

  • Chinese Characters Displaying as Boxes

    My iTunes used to display Chinese characters fine. But today, they all show up as boxes. I originally thought that it was something wrong with Windows, but I'm pretty sure it's an issue with iTunes. I tried to type in Chinese, and it works fine in other programs, but when I do it within iTunes (to change a song title), it becomes a box. And when I browse to the file within My Computer, the filename shows up in Chinese. But if I look at the properties of a song (Get Info), it will show the path with all the Chinese characters replaced by boxes. I believe this problem came up today, as I synced my iPhone last night, and it was fine then. I even tried to change the Language Preferences, but that only changed the menus and my songs are still boxes. Anyone else have this problem?

    Anyone else have this problem?
    Search this forum for "chinese" to find other reports.

  • Problem displaying chinese characters

    I have got the problem with displaying chinese characters in the webpage after fetching the data from database.
    I am using Oracle IAS webserver and oracle 8i as the database which is in UTF-8 characterset.I am getting the out put in the chinese if I use this code.
    String value1 = new String(value.getBytes("ISO8859_1"), "GB2312");
    I am getting the out put using this code in this format
    ��������
    &#27604;&#20998;&#21345;&#29255; basically this code does that.(String value1 = new String(value.getBytes("ISO8859_1"), "GB2312");)
    But some body told me that I have to do some settings in the server.I am using oracel IAS.Can you suggest me any thing?.
    Here is my full code
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <%@ page import="java.nio.charset.Charset,java.util.Locale,org.apache.struts.action.*,java.io.*,javax.naming.Context,java.sql.Connection,javax.sql.DataSource,javax.naming.InitialContext,java.sql.*" %>
    <HTML><HEAD><TITLE>Welcome to METRO</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Content-Encoding" content="UTF-8"/>
    </HEAD>
    <BODY >
    <style type="text/css">
    .tb {      
    border: 1px solid #ddd;
    border-collapse: collapse;
    font-family:arial ,sans-serif;
    font-size: small;
    height:100%;
    width:100%;
    color:#00000000;
    </STYLE>
    <%
    String value="";
    try{
    Connection dbConn;
    Statement stmt=null;
    Context jndiCtx=new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource)jndiCtx.lookup( "jdbc/webdbPooledDS" );
    dbConn= ds.getConnection();
    stmt=dbConn.createStatement();
    String sql="select prog_name_LL2 from test_table where table_name='test'";
    ResultSet rs = stmt.executeQuery(sql);
    if( rs.next()){                    
    value=rs.getString(1);
    System.out.println("value="+value);
    out.println("<table class='tb'><tr><td>"+value+"</font><br>");
    String value1 = new String(value.getBytes("ISO8859_1"), "GB2312");
    out.println(""+value1+"</td></tr></table>");
    rs.close();
    stmt.close();
    dbConn.close();
    }catch(Exception e){
    System.out.println("Exception ="+e.getMessage());
    %>
    </BODY></HTML>

    Follow the steps as listed below:
    1. Is the Font available on Printer
               Goto SP01 transaction -> Enter the Spool Number -> Execute
    2. Does device type/Spool Server support the font
               Goto Transaction SPAD and click Output Devices
    3. SAP level Multibyte setting in place
               Click ALT + F12
               Select Options -> I18N
               Tick Activate Multibyte functionality
    4. Is appropriate font for the language used
              For Simplified Chinese (ZH)  language use font  CNHEI, CNKAI, CNSONG
    SAP Notes related to Fonts
    a.0000776507 SAPscript/SmartForms: Which fonts for which languages?
    b.0000323736 Restrictions with "PDF print" through spooler
    c.0000317851 Creating PDF format using the SAP spooler in 4.6C/4.6B/4.5B
    d.0000012462 How can I define a new printer font?
    e.Note 62178 Device types for the Japanese version of the R/3 System

  • Insert chinese characters to mysql

    I have searched the forum and found a useful links --http://forum.java.sun.com/thread.jspa?threadID=530358 about inserting chinese characters to mysql. However, I can't see the chinese characters displayed in the db. The charset and collation of my table are utf8 and utf8_bin respectively. Can anyone help me? Below is my source code
    ------------------ Servet ---------------------
    package test;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class testServlet extends HttpServlet {
    private Connection conn;
    public void init(ServletConfig config) throws ServletException {
         sSysPhyPath = config.getServletContext().getRealPath("/");
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
         // set content type and other response header fields first
         res.setContentType("text/html");
         // get the communication channel with the requesting client
    PrintWriter out = res.getWriter();
    out.println("<html>");
    out.println("<body bgcolor=\"white\">");
    out.println("<body>");
         req.setCharacterEncoding("UTF-8");
         sValue = req.getParameter("s1");
         out.println(sValue.getBytes("UTF-8") + "<br>");
         DBConnection objConn = new DBConnection(sSysPhyPath);
         try {
              conn = objConn.get();
              objConn.execQuery(conn, "insert into TBL_test (test_desc) values ('" + sValue.getBytes("UTF-8") + "')");
         catch(Exception e) {
              e.printStackTrace();
         objConn.closeConnection(conn);
    out.println("</body></html>");
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
    doGet(req, res);
    public void destroy() {
    --------------- Html ------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body bgcolor="#666666">
    <form name="test" method="post" action="testServlet">
    <input type="text" name="s1">
    <input type="Submit" name="Submit" value="Submit">
    </form>
    </body>
    </html>
    Besides, if I code the chinese characters directly in the servlet page, what is the encoding of the chinese characters by default? Is it related to my OS locale?
    Thanks a lot.

    objConn.execQuery(conn, "insert into TBL_test
    st (test_desc) values ('" + sValue.getBytes("UTF-8")
    + "')");You would be better off using a PreparedStatement and parameters. This will let the MySQL JDBC driver take care of the required encoding.

  • Display chinese characters from oracle 8i database using UTF-8

    I have written a program to retrieve chinese characters from the database and display in the web page.If I change the encoding of the webpage manully it displays the chinese characters(&#27604;&#20998;&#21345;&#29255; ).Or it shows the junk characters(�������� ).Can anybody help so that do I have to do any encoding or any other settings?.I am using Jdeveloper.
    Rgds
    Ganesh
    <HTML><HEAD><TITLE>Welcome to METRO</TITLE>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <%//@ page contentType="text/html; charset=UTF-8" %>
    <%@ page import="java.io.*,java.io.InputStream,java.nio.*,java.lang.*,java.util.*,javax.naming.Context,java.sql.Connection,javax.sql.DataSource,javax.naming.InitialContext,java.sql.*" %>
    </HEAD>
    <BODY >
    <%
    String value="";
    try{
    Connection dbConn;
    Statement stmt=null;
    Context jndiCtx=new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource)jndiCtx.lookup( "jdbc/webdbPooledDS" );
    dbConn= ds.getConnection();
    stmt=dbConn.createStatement();
    String sql="select prog_name_LL2 from wb_prog_new_metro where table_name='SCORE_CARD'";
    ResultSet rs = stmt.executeQuery(sql);
    if( rs.next()){                    
    value=rs.getString(1);
    out.println(value);
    }catch(Exception e){
    System.out.println("Exception ="+e.getMessage());
    %>
    </BODY></HTML>

    Make sure that you have a Unicode font that supports Chinese characters. I have been testing the support of Unicode text (allows many other character and image based languages to be displayed) and have found that it depends on what fonts are available on the system you're viewing the report on. Unicode is supported in Crystal (since version 9 I believe) but it will display '?' or '[]' if there isn't a font to render the text properly.
    This font supports loads of languages: http://www.code2000.net/code2000_page.htm

  • Pls help.JSP: I could not store Chinese characters into files.

    Hi experts,
    I have this problem of cant store chinese characters into files(eg. .txt and .properties). I am adding
    these chinese text through a JSP website form....After i key in chinese characters in the textboxes
    in the website and sumbit the results, my chinese characters turned into ASCII or rather garbage in
    the files.
    Is there any way i can get the exact chinese characters i entered in the webite into the files?
    Need urgent assistance here.
    Thanks
    <%@ page contentType="text/html; charset=big5" %>
    <html>
    <head>
    <title>Confirmation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    </head>
    <%@ page language="java"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.lang.Integer.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.sql.ResultSet.*"%>
    <%@ page import="javax.servlet.*"%>
    <%@ page import="javax.servlet.http.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.URL"%>
    <%
    //getting attributes from previous page form
    //At this point, chinese characters r retrieved
    //Ascii/garbage displayed for text when retrieved from previous page.
    String gameName=request.getParameter("name");
    String encode=request.getParameter("encode");
    String gameType=request.getParameter("type");
    String info=request.getParameter("description");
    int check=0;
    int nextGameID;
    String temp="";
    String langCode="";
    //establish connection
    Connection con = null;
    try {
    Class.forName("org.postgresql.Driver");
    con = DriverManager.getConnection("jdbc:postgresql://172.20.134.110:5432/smsINTFET" , "postgres",
    "postgres");
    catch(ClassNotFoundException e) {
    out.println("Could not load the driver: "+e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught in relax db: "+ e.getMessage());
    Statement stmt = null;
    ResultSet rs = null;
    ResultSet ps = null;
    String strSQL = "";
    String strSQL2 = "";
    String tempCat = "";
    strSQL="SELECT gamename FROM cp_games order by gameid;";
    try {
    stmt = con.createStatement();
    rs = stmt.executeQuery(strSQL);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    while(rs.next())
    check=0;
    temp=rs.getString("gamename");
    if(temp.equalsIgnoreCase(gameName))
    // there is similar record in database
    check=1;
    break;
    else
    check=0;
    if(check==0)
    %>
    <body background="button/bkgd.jpg" bgproperties="fixed">
    <p><b><font size="30pts" face="Monotype Corsiva">Confirmation</font></b></p>
    <HR style="WIDTH: 500px; COLOR: blue; HEIGHT: 3px">
    The following information has been added.
    <table width="75%" border="0" cellspacing="0" cellpadding="2">
    <%
    String strCat="";
    strCat="INSERT INTO cp_games(gamename,description,encode) values('"+gameName+"','"+info+"','"+encode+"');";
    stmt = con.createStatement();
    stmt.executeUpdate(strCat);
    System.out.println("Successful inserted category");
    stmt.close();
    //setting language
    if(encode.equals("ascii"))
    langCode = "US";
    if(encode.equals("ms950"))
    langCode = "TW";
    if(encode.equals("ms936"))
    langCode = "CN";
    strSQL2="SELECT gameid FROM cp_games where gamename = '"+gameName+"';";
    try {
    stmt = con.createStatement();
    ps = stmt.executeQuery(strSQL2);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    ps.next();
    nextGameID=ps.getInt("gameid");
    out.println("<B>The game number : </B>" + nextGameID);
    %>
    <tr>
    <td><B>Game added: </B><%=gameName%>
    </td>
    </tr>
    </table>
    <%
    String newFile="G:\\home\\smsGamesINTV2\\colorGame\\propertiesFiles\\FET\\CP_Game"+nextGameID+"_"+encode+"_"+langCode+".properties";
    try
    {               //begin file
    PrintWriter outFile=null;
    //create a new file and write the initial settings to file
    outFile=new PrintWriter(new FileOutputStream(newFile,true));
    outFile.println("game_intro="+nextGameID+")"+gameName+" - "+info);
    outFile.println("");
    outFile.println("game_title="+gameName);
    outFile.println("");
    outFile.println("game_type="+gameType);
    outFile.println("");
    outFile.println("qns_no=0");
    outFile.println("");
    outFile.println("ana_no=0");
    outFile.close();
    }//end file
    catch(IOException e)
    out.println("File Create Error");
    else // no match found
    out.println("Game,"+temp+ " already added");
    %>
    </body>
    </html>

    try to add this code under this line:
    <%@ page contentType="text/html; charset=big5" %>
    <% response.setContentType("text/html; charset=big5"); %>
    I have faced the problem like yours and it works fine for me. Try and see.

Maybe you are looking for

  • HT1918 How can you change your security account questions

    After your account has been unlocked after eight hours how do you change the security questions answered if you have forgotten ?

  • Big screen, want it normal again?

    Hi, I just connected my macbook pro to a projekter at school, and now my screen is big, how do I get i it back to normal size?

  • Probelm in calling ME23N from WebDynpro ABAP application.

    Dear All, My requirement is to call the transaction ME23N by doing some action from WDA application. And I have to pass the Purchase Order Nubmer from this WDA application. This is for your information, For this I have created the Transactional iView

  • Cannot install iTunes - failure to run preupgrade script

    I get the error message 'failure to run preupgrade script for AppleMobileDevice' when I tried to install itunes. Have tried the steps at this link - http://support.apple.com/kb/HT1747 - but still no luck. Any ideas how I can resolve this?

  • Manual BRS field required with 22 character

    Hi, As per new RBI guidelines Unique Transaction Reference (UTR) for RTGS-NEFT number will be of 22 character in case of incoming customer receipts & payments to vendors by RTGS-NEFT. Same we need to record as reference for clearing in manual BRS (FF