Non-ascii charsets in an applet woes

I'm having trouble getting russian, chinese, japanese, and greek charactersets to display correctly in an applet (plugin is jre 1.4.2_02).
1) yes the strings are in i18n'ized properties
2) yes the non-ascii characters are unicode escaped (i.e. \u####) in the properties file
3) yes the computer displaying the applet has its locale and languages set to the correct language
4) yes the computer displaying the applet has the fonts available to display
All the above is done and works great for ascii or extended ascii sets, but it shows junk for the 4 languages listed above.
Anyone run into this problem before?
Please help me out.
Thanks,
Andrew

Ok, I got Russian and Greek to work. I had to switch all my awt controls to swing.
However, I cannot get the Chinese/Japanese characters to display. I double and triple checked the encodings to make sure it was correct (it is).
However, the font.properties.ja (japanese) lists a font called MSMINCHO.TTC and one called MSGOTHIC.TTC. Both are actually in TTF files on my system. I tried correcting the font.properties.ja with TTF; but to no avail.
Also, font.properties.zh (chinese) lists SIMSUN.TTC - which I do NOT have, but this shouldn't be a problem because both font.properties.zh_TW (trad. chinese) and font.properties.zh_CN (simplified chinese) both list fonts thatI DO have (and the only Chinese locales I support are zh/TW and zh/CN. Is this a problem? If so, where can I get simsun.ttc (I search and searched and could not find the file).
Please help,
Andrew

Similar Messages

  • Non-ASCII chars in applets?

    hi,
    Spent 4 hours to find a way to use non-ASCII chars in applets (buttons, textareas), but didn't make it.
    Simply saying
    TextFieldObj.setText("\uxxxx");
    //or any equivalent obj. Ex. of \uxxxx: \u015F
    doesn't work. I even went into Graphics.paint() example, but it too can paint only ASCII chars.
    My hunch is that it is smt. about Character.Subset but i still can't figure out how to do it.
    Please SOS,
    Reshat.

    Hi,
    I just managed to get Buttons to show Greek characters, so it appears that static buttons are fine.
    However, i still face the same problem for TextField's:
    TextFields work fine for IE, but in NN they sometimes convert into ASCII and sometimes give ? The same in HotJava.
    So there are 2 questions in my head:
    1. why can't NN use the fonts used by IE to display Non-ASCII chars?
    2. What is the safest font to use for Non-ASCII chars, to cover the widest possible audience.
    P.S. Java solves most cross-platform-browser problems, but the font issue still seems to be dependent on a user and his/her browser. It appears Java is not font-independent in non-ASCII context. If so, it would be nice to develop a plug-in to make sure that if the user doesn't have the font, then a Java-standardized Unicode-based font is used. Otherwise, non-ASCII world is still w/o a real Java.)
    Thank you for your feedback,
    Reshat.

  • Can't get the attachment filename out of a Part (with non ascii characters)

    Hello, all and happy new year :)
    My issue is with non ascii filename in attachments... Yes i've read the FAQ : http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename
    I can't get the filename out of the BodyPart for those kind of attachments
    here's my unit test :
         * contains various parts from various mailer encoded in different ways...
         private enum EncodedFileNamePart{
              OUTLOOK("Content-Type: text/plain;\n name=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \n\nnoel 2010\n","c'estdéjànoëlçac'estcool.txt"),
              GMAIL("Content-Type: text/plain; charset=US-ASCII; name=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Disposition: attachment; filename=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Transfer-Encoding: base64\nX-Attachment-Id: f_giityr5r0\n\namluZ2xlIGJlbGxzIQo=\n","déjànoëlçacestcool.txt"),
              THUNDERBIRD("Content-Type: text/plain;\n name=\"=?ISO-8859-1?Q?d=E9j=E0no=EBl=E7acestcool=2Etxt?=\"\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename*0*=ISO-8859-1''%64%E9%6A%E0%6E%6F%EB%6C%E7%61%63%65%73%74%63%6F;\n filename*1*=%6F%6C%2E%74%78%74\n\njingle bells!\n","déjànoëlçacestcool.txt"),
              EVOLUTION("Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt\nContent-Type: text/plain; name*=ISO-8859-1''d%E9j%E0no%EBl.txt; charset=\"UTF-8\" \nContent-Transfer-Encoding: 7bit\n\njingle bells\n","déjànoël.txt"),
              String content=null;
              String target=null;
              private EncodedFileNamePart(String content,String target){
                   this.content=content;
                   this.target=target;
              public Part get(){
                   try{
                   ByteArrayInputStream bis = new ByteArrayInputStream(this.content.getBytes());
                   Part part = new MimeBodyPart(bis);
                   bis.close();
                   return part;
                   catch(Throwable e){
                        return null;
              public String getTarget(){
                   return this.target;
         @Test
         public void testJavamailDecode() throws MessagingException, UnsupportedEncodingException{
              System.setProperty("mail.mime.encodefilename", "true");
              System.setProperty("mail.mime.decodefilename", "true");
              for(EncodedFileNamePart part : EncodedFileNamePart.values())
                   assertEquals(part.name(),MimeUtility.decodeText(part.get().getFileName()),part.getTarget());     
    I take a NullPointerExcepion in the decodeText because getFileName() return null for the EVOLUTION case, and work well with OUTLOOK, THUNDERBIRD and GMAIL.
    Evolution's content type is "Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt" wich doesn't look like the other (looks like the RFC 2616 or RFC5987 to do it.)
    How can i handle this situation except by writting my own decoder?
    Thanks for your answers!
    Edited by: user13619058 on 4 janv. 2011 07:44

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • Cannot login with password containing non-ascii characters

    Hello,
    I have web application, form based login. UTF-8 is specified "everywhere".
    And it works, except for passwords.
    If user register itself with password containing non-ascii characters, it is correctly written in database, but when doing either programmatic login or normal form based login, if fails.
    If the password is only ascii, it works.
    Username of login could be ascii or non-ascii, it doesn't matter, both works.
    I'm using sun java application server 9.1.
    jdbc realm.
    I'm not using hashing passwords, just clean (now)
    I tried configure realm Charset: UTF8 as last chance, but it doesn't work either.
    The problem is only with non-ascii characters in password.
    Any help very appreciated
    Thanks a lot

    hi,
    I know all that, but that's not the case. My app uses preparedStatements, everything is properly configured, in all pages, utf-8 is going from user to db and back without any problems.
    The only problem is with password field. As I am using form based login, with jdbc realm configured (again, nicely working when only ascii characters), I have very little chance to do something bad through the login phase.
    I'm not talking about special characters, I'm talking about non-ascii characters, let's say - Chinese, arabish, Russian alphabet etc.
    When user registers (my code), the fields are properly written to db. I have checked that, trust me.
    But the Sun app server realm seems to have some problems with the password field.
    (realm uses jdbc connection to mysql, the url contains all extra parameters to be sure about utf8. there is nothing more what can be configured...)
    If I try other alphabet codes in login and ascii in password, it works. But soon, as I use other alphabet code also in password, it doesn't work anymore.
    My only idea is, that I could try MD5 to create ascii only characters (I hope it works that way) on the client with javascript and then set Digest to MD5 in realm configuration. But still, it seems very strange. The clear way storage should also function? (now set Digest to 'none')
    Is it a bug of Sun App Server?
    thanks

  • File upload with non-ascii name

    I'm designing a system that includes file-uploads. My problem is that any non-ascii chars in the filename are encoded strangely when saved. ä is encoded to å etc.
    I use Tomcat with the -Dfile.encoding="UTF-8" in the Catalina file. I get the same result despite method; my own implementation, apache commons or Javazoom's uploadBean. All the JSP charset parameters are set.
    Any ideas?

    Hi amitads,
    I'm sure u've used Java enough. Also, u must have learned about the \ (backslash) escape character ?
    So, if u want to include a string like a single quote, u can write \' and for a double quote u can write \".
    Try this ... I'm sure it will help.
    Keep me posted.
    Cheers !!
    Sherbir.

  • Issue with Download and Loss of Non-ASCII Characters

    I have a need to allow my user to download the contents of an HTML Region as a file. This region contains some Greek letters, i.e. non-ASCII, used with some common finance formulas.
    I am able to copy the contents off this region using JavaScript without any issue.
    Moreover, I can copy the contents from JavaScript into a Page Item and then render the region with PL/SQL. Again, this works without an issue.
    However, when I try to download the region, the Greek letters are lost in the downloaded document. Instead they are replaced with this weird series of characters: (Δ
    I've created a sample app to demonstrate this problem at apex.oracle.com:
    URL: http://apex.oracle.com/pls/apex/f?p=34765:1
    UID: GUEST_DEV
    PWD: greeksgone
    Click the button labeled "Copy HTML Via JS" and you will see the statically populated region copied into the second region.
    Click the button labeled "Copy HTML Via APEX" and you will see the statically populated region copied into the third region. This is achieved by copying the HTML into a Page Item and then submitting the page. When the page returns, the value of this Page Item is then used to populate the third region. As you can see, the Greek letters are there as normal.
    However, if you click the "Download HTML" button you will see the the Greek letters are not present in the resulting file.
    -Joe

    Joe Upshaw wrote:
    I am just totally stuck here.
    This is what the document looks like without the required meta tag:
    <HTML>
    <BODY>
    <STYLE>
    <DIV>
    div.riskScenarioMatrixDiv
    overflow:auto;
    ....This version does not display the greek letters.
    If I could simply add this one meta tag in, everything would work beautifully:
    <HTML>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <BODY>
    <STYLE>
    <DIV>
    div.riskScenarioMatrixDiv
    overflow:auto;
    ....However, I have tried every combination I can think of in the code block but, any time that I add that meta tag, I get a *404 Page Not Found* error.
    The only thing standing between what we have and what we need is getting that meta tag in the output but, I just can't seem to find a way to do this. Actually, we'd really like to have, within the head tags; the meta tag, the style and the title but, not being able to get that meta tag in is the difference between acceptable and broken. It works with the others in the body.
    DECLARE
    ls_RiskMatrixTitle  VARCHAR2(32767);
    ls_RiskMatrixHTML   VARCHAR2(32767);
    ls_DefaultFileName  VARCHAR2(512);
    BEGIN
    ls_RiskMatrixHTML   := :P1_HTML;
    ls_DefaultFileName  := 'TestMe.html';         
    ls_RiskMatrixTitle  := 'Test of Download';        
    OWA_UTIL.MIME_HEADER( 'text/html',  False, 'UTF8' );
    HTP.P( 'Content-Disposition: attachment; filename=' || ls_DefaultFileName );
    --HTP.META( 'Content-Type',  null, 'text/html; charset=utf-8' );          
    --HTP.TITLE( ls_RiskMatrixTitle ); 
    OWA_UTIL.HTTP_HEADER_CLOSE;
    HTP.HTMLOPEN;   
    HTP.BODYOPEN;
    HTP.STYLE('<DIV>' || :P1_MATRIX_STYLE || '</DIV>');
    HTP.P(ls_RiskMatrixTitle);
    HTP.P(ls_RiskMatrixHTML);
    APEX_APPLICATION.G_UNRECOVERABLE_ERROR := True;
    END;
    You appear to be confusing HTTP and HTML.
    The HTTP header != HTML <tt>head</tt> element.
    HTP.META( 'Content-Type',  null, 'text/html; charset=utf-8' );          
    HTP.TITLE( ls_RiskMatrixTitle );  This generates HTML content. It does not go in the HTTP header. You should be generating an HTML <tt>head</tt> element containing this (and the <tt>style</tt> element) between <tt>HTP.HTMLOPEN</tt> and <tt> HTP.BODYOPEN</tt>.
    Also note that these web toolkit methods generate really obsolete HTML, therefore I never use them (and nor does APEX these days).
    Don't have time to get more into this now...

  • Java 5, Linux, 64-bit: Non-ASCII chars over socket

    Hi,
    I am having issues with reading non-ASCII chars from a socket. I send a mixed message, with the first part in ASCII and the last bit in non-ASCII. There are no issues with reading the non-ASCII characters on Windows. However, when I try running the server on Linux. The following is a message sample:
    Start message<CRLF>
    &#1092;&#1074;&#1072;&#1092;&#1099;&#1074;&#1072;&#1092;&#1074;&#1099;&#1072;&#1092;&#1099;&#1074;<CRLF>
    The second part (which is encoded in either Windows-1250 or KOI8-R), comes out as 3F (when you look at the bytes) on Linux.
    Any suggestions?
    Thanks,
    Max

    You must be using Readers and Writers, and you need to make sure you specify the same charsets when constructing them. Don't leave this to the default, as this seems to vary across platforms and definitely has varied across releases.

  • FILE_DATASTORE and non-ASCII chars

    I have created an interMedia Text index
    with the FILE_DATASTORE option, so that
    interMedia treats table entries as
    filenames and indexes the corresponding
    file on the servers's filesystem.
    But whenever the filename contains characters
    which are not part of the US7ASCII charset (like dv| _), the file is not found. But both Oracle and the operating system support these characters.
    The Oracle instance uses UTF8 as internal
    characterset. The client which stores
    the filenames in the table uses the
    WE8ISO8859P1 charset. The values in the
    database table are stored and shown correctly
    when viewed with Oracle or Java client
    programs.
    So where does the charset conversion fail ?
    The names are stored correctly, they can be
    read correctly by clients, but the indexer
    seems to use a wrong charset to translate
    the filenames stored in the database into
    filenames of the operating system.
    Do I have to apply some additonal configurations to my indexer ?
    Greetings,
    Michael Skusa
    null

    I bump Dr. Chucks thread for a similiar problem with non-ascii chars.
    The chars show up but the sorting is a bit off.
    Example: A, Å, B, ... Z
    Should be: A, B, ... Z, Å, Ä, Ö
    In Swedish Å (the letter Aring;) is one of the last letters and should not be placed after A despite being similiar.
    Any ideas?

  • What is current CommSuite support for non-ASCII passwords?

    Hello all,
    Some of our users managed to change their passwords to non-ASCII strings (via replication from MSAD by ISW) and no longer have access to their communications services.
    While replicating the problem, I have set a (UTF-8 non-ASCII) string as my password in DSEE directly, and *can* log in to Convergence with this password. However, if I change the working password to a non-ASCII string from Convergence itself - it is accepted during the secondary password check, there is no error returned, SOME password is apparently saved into the LDAP directory, but neither of the original non-ASCII plaintext strings can be used for login back into Convergence. Restoration of access is only doable by admin at this point.
    Checking email by IMAP from Thunderbird no longer works with a changed non-ASCII password (including the state when it still works for Convergence).
    Delegated Admin has an explicit check for non-ASCII characters in the password and refuses to set a misbehaving one.
    I see that among the standards supported by CommSuite, there is IMAP4rev1, and RFC 5255 refers to it as the reason that non-ASCII passwords and usernames are for now not supported, though this is expected to be a temporary state of things, and software can prepare for the future by implementing checks for valid UTF-8 strings as well.
    https://wikis.oracle.com/display/CommSuite/Messaging+Server+Supported+Standards
    http://tools.ietf.org/html/rfc5255
    5.1.  Unicode Userids and Passwords
       IMAP4rev1 currently restricts the userid and password fields of the
       LOGIN command to US-ASCII.  The "userid" and "password" fields of the
       IMAP LOGIN command are restricted to US-ASCII only until a future
       standards track RFC states otherwise.  Servers are encouraged to
       validate both fields to make sure they conform to the formal syntax
       of UTF-8 and to reject the LOGIN command if that syntax is violated.
       Servers MAY reject the LOGIN command if either the "userid" or
       "password" field contains an octet with the highest bit set.
       When AUTHENTICATE is used, some servers may support userids and
       passwords in Unicode [RFC3490] since SASL (see [RFC4422]) allows
       that.  However, such userids cannot be used as part of email
       addresses.
    So, the main question at this point is: does or does not all of the CommSuite stack support non-ASCII passwords?
    If no - please confirm, so we can instruct the users to not create problems for themselves (and maybe manage to set up some policy to not accept non-ASCII passwords to MSAD/DSEE in the first place).
    If yes - what should be done to enable support in Convergence/IMAP/SMTP/XMPP/WCAP/WABP/... services - perhaps, setting the LANG/LC_ALL locale environment variables or equivalent JVM flags for UTF-8 in server startup scripts, etc.? (I know that DSEE ldapsearch requires either envvars or a command-line flag for charset encoding of values, so I figure similar quirks may be relevant for some other software)
    Thanks in advance for either response,
    //Jim Klimov

    I can't respond for the suite, but the Messaging Server product should work with UTF-8 usernames and passwords as long as the standard SASL authentication mechanisms that are documented to use UTF-8 are used (e.g. SASL PLAIN). IMAP LOGIN may work fine with UTF-8 as well even though that's non-standard. We do not implement SASLprep, however, so the strings provided by the client to the server must be identical UTF-8 strings for authentication to succeed. If they are provided in a different decomposition, different canonical form or non-standard charset, that's not supported and will fail. We don't test this scenario extensively, so you may encounter bugs (that we'd have to prioritize and fix as with other bugs). Messaging Server recently implemented a restricted option (broken_client_login_charset) for a customer who was stuck with broken clients that sent ISO-8859-1 for the IMAP login command arguments.

  • URGENT!! Drill Down Error with Character Set non-ascii on Discoverer Viewer

    Hi,
    We have an error in a Drill down. It comes up when the Discoverer Viewer tries to process data that contains special character (non-ascii) in a query's filter. The same report that does not perform well with special characters, does perform well if the data don’t contains special characters, so it seems to be an issue processing non-ascii chars in this Discoverer Viewer instance.
    Ex. FIELD_NAME = 'öÜæäé (This filter is contained in a query that this getting an error msg="We're sorry, the server encountered an unexpected condition" ).
    It might be possible that there are some problems with the Discoverer charset ?
    We will appreciate any suggestion about this respect.
    Regrads,
    Seba.

    Sure,
    This is the hole sql command that get an error in a drill down action process
    SELECT NVL (sf_dw_people_skills.major_name, 'No Major'),
    sf_dw_people_skills.minor_name, sf_dw_people_skills.skill_name,
    sf_dw_people_skills.skill_level,
    sf_dw_people_all_rel_v.supervisor_name,
    sf_dw_people_all_rel_v.person_name, sf_dw_people_all_rel_v.LOCATION,
    sf_dw_people_all_rel_v.supervisor_dir_name, COUNT (1)
    FROM olnreport2.sf_dw_people_all_rel sf_dw_people_all_rel,
    olnreport2.sf_dw_people_skills sf_dw_people_skills,
    olnreport2.sf_dw_people_all_rel_v sf_dw_people_all_rel_v,
    olnreport2.sf_dw_competences_rel sf_dw_competences_rel
    WHERE ( (sf_dw_people_all_rel.person_id = sf_dw_people_skills.person_id
    AND (sf_dw_people_all_rel_v.person_id =
    sf_dw_people_skills.person_id
    AND (sf_dw_competences_rel.skill_id = sf_dw_people_skills.skill_id
    AND (sf_dw_people_all_rel_v.supervisor_id =
    sf_dw_people_all_rel.supervisor_id
    AND (sf_dw_people_all_rel_v.supervisor_name = 'Kunz, Jürgen Mr') /*When I replace the charset 'ü' by u, it´s work ok*/
    AND (sf_dw_people_skills.minor_name = 'HRMS')
    AND (sf_dw_people_skills.skill_name = 'HR Intelligence')
    AND ( sf_dw_competences_rel.competence_type = :"competence_type"
    AND sf_dw_competences_rel.competence_id IN ((:"competence_id"))
    AND (sf_dw_people_all_rel.supervisor_id IN ((:"Manager")))
    AND ((( :"resource_manager" <> -1
    AND olnreport2.do_val_person_job_prod
    ('RESOURCE_MANAGER_VIEW',
    sf_dw_people_skills.person_id,
    sf_dw_people_skills.job_code,
    sf_dw_people_skills.product_code,
    :"resource_manager"
    ) = 'Y'
    OR :"resource_manager" = -1
    GROUP BY NVL (sf_dw_people_skills.major_name, 'No Major'),
    sf_dw_people_skills.minor_name,
    sf_dw_people_skills.skill_name,
    sf_dw_people_skills.skill_level,
    sf_dw_people_all_rel_v.supervisor_name,
    sf_dw_people_all_rel_v.person_name,
    sf_dw_people_all_rel_v.LOCATION,
    sf_dw_people_all_rel_v.supervisor_dir_name;
    Regards,
    Seba.

  • Non ascii characters are padding without reason

    Hi all,
    here is my issue :
    I have description field in my jsp page, when user enters some non ASCII characters as shown below :
    This is user had entered the input string is :
    "Hello ������� Hello" (without quotes)
    When he edits for the first time without change anything in the the string and save, then it became :
    "Hello Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã? Hello" (without quotes)
    Then again one more time, it became :
    "Hello Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â?Ã?Â? Hello" (without quotes)
    Like wise it is getting increased its size. I'm saving the data to Oracle 10g database from jsp.
    Please suggest what to do to rectify the problem.
    Thanks & regards,
    Achchayya

    But I didnt changed anything from server.xml except two changes
    1) from : <?xml version='1.0' encoding='iso-8851-1'?>
        to : <?xml version='1.0' encoding='UTF-8'?>
    2)
    from : <Connector port="8888" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443" />
    to : <Connector port="8888" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443"
                   URIEncoding="UTF-8"/>here is my JSP :
    <%@ page pageEncoding="UTF-8" %>
    <html>
    <head>
    <title>The servlet example </title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    </head>
    <body>
    <h1>A simple web application</h1>
    <form method="POST" action="HelloWorld">
    <label for="name">Enter your name </label>
    <input type="text" id="name" name="name"/><br><br>
    <input type="submit" value="Submit Form"/>
    <input type="reset" value="Reset Form"/>
    </form>
    </body>
    </html>Servlet Code :
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class HelloWorld extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    * Get the value of form parameter
         System.out.println("response char set "+response.getCharacterEncoding());
         System.out.println("request char set "+request.getCharacterEncoding());
    response.setCharacterEncoding("UTF-8");
    String name = request.getParameter("name");
    String welcomeMessage = "Welcome "+name;
    System.out.println("Name : "+name);
    * Set the content type(MIME Type) of the response.
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    * Write the HTML to the response
    out.println("<html>");
    out.println("<head>");
    out.println("<title> A very simple servlet example</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>"+welcomeMessage+"</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         response.setCharacterEncoding("UTF-8");
         doPost(request, response);
    } web.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/HelloWorld</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>
    HelloWorld.html
    </welcome-file>
    </welcome-file-list>
    <context-param>
         <param-name>PARAMETER_ENCODING</param-name>
         <param-value>UTF-8</param-value>
    </context-param>
    </web-app>please have a look at my files and suggest me BalusC.
    Thanks for your patience.
    regards,
    Achchayya
    Edited by: achayya on Oct 16, 2009 7:26 AM

  • A Download servlet: non-ASCII characters not working

    This is my servlet used for file download:
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
      String filepath = request.getParameter("filepath");
      String filename = request.getParameter("filename");
      response.setContentType("application/zip");
      response.setHeader("Content-Disposition", "attachment;filename=\""+filename+"\";");
      ServletOutputStream sos = null;
      BufferedInputStream bis = null;
      try {
        sos = response.getOutputStream();
        bis = new BufferedInputStream(new FileInputStream(source));
        byte buffer[] = new byte[2048];
        int c;
        while((c = bis.read(buffer)) != -1)
          sos.write(buffer, 0, c);
      } catch(Exception e) {
      } finally {
        bis.close();
        sos.close();
    }It does not work when the filename contains non-ASCII characters (e.g., extended ASCII, CJK ...)
    What do I fix this? Thanks!

    One possiblitiy that occurs to me is you have too many encoding things going on and you are sorta "over-encoding" things, as it were....
    All I can think to do is give you this sample JSP page that I created when I was trying to figure all this web encoding stuff with forms back in the day. So perhaps you can use this as a basis for your own page.
    // _lang.jsp
    <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title></title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body bgcolor="#ffffff" background="" text="#000000" link="#ff0000" vlink="#800000" alink="#ff00ff">
    <%
    request.setCharacterEncoding("UTF-8");
    String str = "\u7528\u6237\u540d";
    String name = request.getParameter("name");
    %>
    req enc: <%= request.getCharacterEncoding() %><br />
    rsp enc: <%= response.getCharacterEncoding() %><br />
    str: <%= str %><br />
    name: <%= name %><br />
    <br />
    <a href="_lang.jsp?name=<%= java.net.URLEncoder.encode(str, "UTF-8") %>">as link</a>
    <br />
    <br />
    <form method="GET" action="_lang.jsp" encoding="UTF-8">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="GET Submit" />
    </form>
    <form method="POST" action="_lang.jsp" encoding="UTF-8">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="POST Submit" />
    </form>
    </body>
    </html>

  • Non ascii characters being sent from a parameter in a form

    Hi!
    I have seen many topics posted on passing non ascii characters through parameters from one servlet to another and converting them into whatever format is necessary.
    However, I have not seen anyone answer the following question. I have a jsp page (html) with the character encoding set to utf-8. The user inputs some data in to a text field which is inside a form. The data could be in non ascii characters such as hebrew or arabic. This form is then sent to another jsp where i try to retreive the data from teh text field. No matter what i do, i cannot get the data presented correctly. It is either question marks or other wierd symbols.
    I have tried every permetation of encoding of the actual html page, the ecoding of the string from request.getParameter etc but it still is not presented on the new html page correctly.
    Can anyone help??
    Spencer

    Ok, I solved the problem.
    I had to put at the top request.setCharacterEncoding("utf-8");
    Spencer

  • Replacing non-ASCII characters with HTML charcter references

    Hi All,
    In Oracle 10g or greater is there a built-in function that will convert a string with non-ASCII characters like this
    a b č 뮼
    into an ASCII string with HTML character references like this?
    a b & # x 0 1 0 D ; & # x B B B C ;
    (note I had to include spaces between each character in the sample code for message to prevent the forum software from converting my text)
    I tried using
    utl_i18n.escape_reference( val, 'us7ascii' )
    but for some reason it returns
    a b c & # x B B B C ;
    Note how it converted the Western European character "č" to its unaccented counterpart "c", not "& # x 0 1 0 D ;" (is this a bug?).
    I also tried a custom solution using regexp_replace and asciistr (which I can't include here because the forum software chokes on it) but it only returns the correct result for values <=4000 characters long. Unfortunately asciistr doesn't appear to accept CLOB values larger than 4000 characters. It returns an error message like
    (ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 30251, maximum: 4000) ).
    I'm looking for a solution that works on CLOB data of any size.
    Thanks in advance for any insight you can provide.
    Joe Fuda

    So with that (UTF8) in mind, let's take another look.....
    As shown below, I used a AL32UTF8 database.
    Note: I did not use a unicode capable tool for querying. So I set console mode code page to 1250 just to have č displayed properly (instead of posing as an è).
    Also, as a result of using windows-1250 for client character set, in the val column and in the second select's ncr column (iso8859-1), è (00e8) has been replaced with e through character set conversion going from server back to client.
    Running the same code on a database with a db character set such as we8mswin1252, that doesn't define the č (latin small c with caron) character, would yield results with a c in the ncr column.
    C:\>chcp 1250
    Aktuell teckentabell: 1250
    C:\>set nls_lang=.ee8mswin1250
    C:\>sqlplus test/test
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri May 23 21:25:29 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the OLAP option
    SQL> select * from nls_database_parameters where parameter like '%CHARACTERSET';
    PARAMETER              VALUE
    NLS_CHARACTERSET       AL32UTF8
    NLS_NCHAR_CHARACTERSET AL16UTF16
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'us7ascii') NCR from dual;
    VAL  NCR
    č e  c e
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'we8iso8859p1') NCR from dual;
    VAL  NCR
    č e  &# x10d; e     <- "è"
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'ee8iso8859p2') NCR from dual;
    VAL  NCR
    č e  č &# xe8;
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'cl8iso8859p5') NCR from dual;
    VAL  NCR
    č e  &# x10d; &# xe8;In the US7ASCII case, where it should be possible for all non-ascii characters to be escaped, it seems as if the actual escape step is skipped over.
    Hope this helps to understand whether utl_i8n is usable or not in your case.
    Message was edited by:
    orafad
    Fixed replaced character references :)

  • Unable to play videos with non-ASCII-characters in filename

    Hi!
    I use a MediaPlayer to display MP4-videos in my application. This works quite well. Unfortunately I have a problem if the filename of the video to be shown contains non-ASCII-charcaters.
    I get the following message:
    -->file:D:\daten\avi\��� ����.MPG
    Error: Unable to realize com.sun.media.amovie.AMController@4b7651
    Failed to realizeThe first line shows the filename I pass to the setMediaLocation()-method of the MediaPlayer-object.
    What's wrong? If I rename the file to ABC.mpg it works fine.
    Thanks for your help
    Thomas

    Hi!
    I use a MediaPlayer to display MP4-videos in my application. This works quite well. Unfortunately I have a problem if the filename of the video to be shown contains non-ASCII-charcaters.
    I get the following message:
    -->file:D:\daten\avi\��� ����.MPG
    Error: Unable to realize com.sun.media.amovie.AMController@4b7651
    Failed to realizeThe first line shows the filename I pass to the setMediaLocation()-method of the MediaPlayer-object.
    What's wrong? If I rename the file to ABC.mpg it works fine.
    Thanks for your help
    Thomas

Maybe you are looking for

  • I have a question about airplay multiple speakers in Mountain lion

    I seem to be unable to use the "multiple speakers" feature in iTunes now that I've upgraded to Mountain Lion.  Before, I was able to stream music from my iTunes to two airport expresses throughout the house, simultaneoulsy with the computer's speaker

  • F-43 Entering Vendor Invoice error

    Hi all, I am trying to do a vendor invoice through F-43. I entered all the details. In Tax data while i am selecting GOTO in menu bar, the DETAILS button is grey out. i want that option to work. where is the setting for this. Thanx in advance Regards

  • QosmioPlayer needed for Qosmio G30-177

    I've just bought a Qosmio G30-177 from a friend, but it's not a brandnew laptop and this is my problem. My Lappy cannot using QosmioPlayer , when my lappy turn off i press one of the 11 AV button but my lappy doesn't start QosmioPlayer , instead of t

  • Problem with memo field displaying

    I have a table in MS access with a memo field. Everything the user inputs in the field is recorded in the table. When I try to output the memo field I am on getting part of the field. Attached is the code for displaying the data from the acty_comment

  • UWL iview layout - move buttons/userdecision position

    Currently in EP7.0 SPS 12 the layout of our UWL preview is: Title Attributes Description Attachments DescisionHandler Buttons I have the requriement to move the buttons/userdecision to the to the top? Can anyone provided details on where and how this