Problem md5 urldecoded utf-8 (kanji)

hi,
i got a kind of funny problem here. when i try to md5 a urldecoded utf-8 kanji (chinese character set) i am getting always the same digest back. does anybody know what could cause this?
thanx.

I think you need to post some code!

Similar Messages

  • Problems with urldecoding of %

    hi,
    in my servlet's post method i set
    request_.setCharacterEncoding("UTF-8");
    and then i gonna urldecode the parameters with
    String value = request_.getParameter(PARAM);
    String decValue = URLDecoder.decode(value.trim(), "UTF-8");
    everything seems to work fine (even for some chinese utf-8 codes).
    the only problem i got now is the "%".
    i know that the urlencoded value is %25. however when i read out the
    parameter there is only the % left (before i urldecode it). i don't quite
    understand why this happens. i thought i should get the %25 before i
    decode it. i am a bit puzzled because it works with other unicodes.
    anybody out there who knows what happens?
    thanx.

    You don't need to decode it, the server already does it for you. Just call setCharacterEncoding and getParameter and you're done.

  • Problem setting Unicode (utf-8) in http header using tomcat

    Hi:
    I am trying to set a file name in utf-8 to http header using the following code:
    response.setContentType("text/html; charset=utf-8");
    response.setHeader("Content-disposition", "attachment; filename=解決.zip");
    // I actually has file name in utf-8 here to set to the header, and I know that the name is correctly
    // and I also looked into the response object MimeHeaders object and saw the head is correctly there
    then write the content of zip file using ServletOutputStream.
    The problem I have is that the file name is not displayed correctly when prompted to save or open in the pop up window next. I found out using Fiddler that the request header is wrong:
    Content-disposition: attachment; filename=�zn��.zip
    I am using Tomcat 5.0.28. Any idea how to get this working?
    Thanks in advance!

    You are setting the charset for the content to be UTF-8. (That is why the method is called setContentType.) But HTTP headers are not part of the content and so that has no effect on the header.
    The original specification for HTTP only allowed US-ASCII characters in headers. It is possible that more recent versions have features that allow for non-ASCII header data, but I don't know if that is the case or how you would use those features if they exist.

  • Problem with URLDecoder.decode(s, enc)

    Hi!
    I'm having problems with the URLDecoder.decode(s, enc) method... When I send a string, encoded with the Javascript escape() function, to the server side of my application, I get a problem decoding it using this:
    myString = URLDecoder.decode(myString, "iso-8859-1");It gives me this error: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u2"
    My html defines the encoding as follows:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />The string being submitted contains a special apostrophe ( ' ) copy/pasted from MS Word wich then translates it as %u2019 (what's that??? Unicode???).
    Can anyone tell me what is happening? How can I encode / decode this properly?

    I'm having exactly the same issue.
    Did you solved the problem?
    Regards,
    Gabriel

  • Problem: JSP, MySQL, UTF-8

    Hello!
    I use Netbeans 6.5, MySQL 5.0.67, Apache Tomcat 6.0.18, MySQL Connector J 5.1.6 to write simple web database application in JSP. Now I have problem with encoding of non-latin character strings returned from database.
    Database was created by query:
    CREATE DATABASE mydb DEFAULT CHARACTER SET = utf8Resource was defined in context.xml as follows:
        <Resource name="jdbc/ipdbDatasource"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/ipdb_10?autoReconnect=true&characterSetResults=UTF-8"
            username="root"
            password=""
            maxActive="100"
            maxIdle="30"
            maxWait="10000"/>Test page source is:
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <sql:query var="rooms" dataSource="jdbc/ipdbDatasource" >
        SELECT address, descr FROM room
    </sql:query>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1>&#1058;&#1077;&#1089;&#1090;&#1086;&#1074;&#1072;&#1103; &#1089;&#1090;&#1088;&#1072;&#1085;&#1080;&#1094;&#1072;</h1>
            <c:forEach var="room" items="${rooms.rows}">
                <p>${room.address}</p>
            </c:forEach>
        </body>
    </html>Page header <h1> content is OK, but ${room.address} appears in wrong encoding. What can cause this problem?

    I would suggest that you start by looking a jdbc only. JSP is not JDBC. XML is not JDBC.
    Moreover the ONLY way to determine what is actually being extracted from the database in a text value is to print the characters as integers. If you attempt to display them using ANYTHING (System.out, swing, xml, file io) then they will be mapped. And mapped data is not the same as what you got from the database.

  • Problems displaying a utf-8 page on firefox on windows server 2003 however the same version of firefox is working fine on windows xp, is there any specific thing to check on windows server 2003?

    firefox is having problem displaying utf-8 page on windows server 2003 however the same version of ff is working fine on windows xp, is there any configuration to check on windows 2003?

    Can you post a link and attach screenshots to show the difference?

  • Problems writing a UTF-8 text file

    Hi,
    I'm trying to write a txt-file from a String array (data) in Unicode, that I need to process in a program working with the UTF-8 encoding. Every array entry (a string) must be written to a new line.
    Reading the tutorial, I tried
    FileOutputStream outputFile = new FileOutputStream ("aFile.txt");
    Writer out = new OutputStreamWriter(outputFile, "UTF8");
    for(j=0;j<data.length;j++){
         out.write(data[j]+'\n');
    All characters are set to UTF-8, except the New Line character ('\n'), which a UTF8 text editor doesn't recognise. The result is a txt-file of one line, with an 'error square' between the data-values.
    Does anybody knows how to encode the file, so that it works in UTF8-encoded systems?
    thanks,
    Koen.

    except the New Line character ('\n'), which a UTF8 text editor doesn't recognise.This is a valid UTF-8 character, however. Your complaint is not that the editor doesn't recognize it, your complaint is that the editor chooses to render it as a square block.
    Perhaps your problem is that the editor in question is that one from Microsoft? In that case all you have to do to make it act right is to use \r\n instead of \n.

  • Problem with language(UTF-8)

    hi
    I am not getting proper output while. while reading data from access(mdb) file.
    every time i got ????? as out put.
    i have an Tamil stuff in my access file.
    thanks
    gag

    Possibilities
    1) You have not setup the database/table to store UTF-8 characters
    2) You did not put your data into the database properly
    3) You are not extracting the data properly
    4) Your 'viewer' does not have glyphs for the 'bad' characters

  • UTF-8 encoding problem in HTTP adapter

    Hi Guys,
    I am facing problem in the UTF-8 multi-byte character conversion.
    Problem:
    I am posting data from SAP CRM to third party system using XI as middle ware. I am using HTTP adapter to communicate XI to third party system.
    in HTTP configuration i have given XML code as UT-8 in the XI payload manipulation block.
    I am trying to post Chines characters from SAP CRM to third party system. junk characters are going to third party system. my assumption is it is double encoding.
    I have checked the Xml messages in the Message monitoring in XI, i can able to see the chines charaters in XML files. But in the third party system it is showing as junk characters.
    Can you please any one help me regarding this issue.
    Please let me know if you need more info.
    Regards,
    Srini

    Srinivas
    Can you please go through the SAP Notes 856597 Question No.3 which may resolve your issue? Also have you checked SAP Notes 761608,639882, 666574, 913116, 779981 which might help you.
    ---Satish

  • Problem while sending unicode (utf-8) xml to IE.

    Hi,
    I have encoding problem while sending utf-8 xml from servlet to IE (Client), where i am parsing the xml using Ajax.
    In the log I can see proper special characters that are being sent from the servlet. but when same is seen in the client end,, it is showing ? symbols instead of special charcters.
    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new StreamResult(new OutputStreamWriter(stream, "iso-8859-1")));
    _response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _response.getWriter().println(new String(stream.toByteArray(),  "UTF-8"));
    In the log i can see :
    <response status="success" value="1154081722531" hasNextPage="false" hasPreviousPage="false" ><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd �" mode="edit" column_en_US="asdasd �" column_de_DE="? xyz" column_fr_FR="" ></row></response>
    But in the Client side I am able to see
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <response status="success" value="1154082795061" hasNextPage="false" hasPreviousPage="false"><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd ?" mode="edit" column_en_US="asdasd ?" column_de_DE="? xyz" column_fr_FR=""/></response>
    I am getting ? instead of �.
    It will be greatful if somebody tell how to send utf xml from servlet, for ajax purpose.
    Thanks,
    Siva1

    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new
    ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new
    StreamResult(new OutputStreamWriter(stream,
    "iso-8859-1")));Here you produce XML that's encoded in ISO-8859-1. (!!!)
    _response.setContentType("text/xml; charset=UTF-8");Here you tell the browser that it's encoded in UTF-8.
    _response.getWriter().println(new String(stream.toByteArray(), "UTF-8"));Here you convert the XML to a String, assuming that it was encoded in UTF-8, which it wasn't.
    Besides shooting yourself in the foot by choosing ISO-8859-1 for no good reason, you're also doing a lot of translating from bytes to chars and back again. Not only is that a waste of time, it introduces errors if you don't do it right. Try this instead:_response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _transformer.transform(new DOMSource(document_),
                    new StreamResult(_response.getOutputStream()));

  • Cp-1251 utf-8 converting: problems with russian letters

    Hello every one!
    I have faced a major problem in cp-1251 to utf8 string convertion (in Windows):
    String result2 = new String(result.getBytes("utf8"), Charset.forName("cp-1251"));Everything works fine, but there is a problem with russian letter &#1048; (10th letter in the alphabeth).
    cp-1251 byte code of &#1048; is 200
    The right byte code for &#1048; in utf-8 is : 208 152, but I recieve the byte code 208 63 for &#1048;. So there must be some mistake.
    So, when i try to read this string, i face a problem with wrong utf-8 charset...
    I tried this code on Debian, everything works fine.
    I will be glad if you are capable of helping me.
    Thank you.
    Edited by: smikler on Sep 27, 2009 10:25 AM
    Edited by: smikler on Sep 27, 2009 10:27 AM

    Your code makes no sense.
    You're taking a String and asking for it to be turned into a stream of bytes according to the UTF-8 character encoding. And then you're giving these bytes back and asking to have them interpreted back into characters using the CP-1251 character encoding. This is bound to fail, because the bytes aren't in CP-1251 - they're in UTF-8 as you requested.
    The very concept of changing the character encoding of a String is meaningless. Strings in Java are represented in Unicode. It's only when you convert to and from bytes (using the two methods you've used) that you worry about encoding/decoding.
    So, why not describe what you're actually trying to achieve?

  • Kotoeri Kanji Problems (Japanese input)

    Hi all, nice to meet you!
    I've been having a problem with Kotoeri (specifically, the kanji input). I have been using kotoeri for months with no problems... but alll of a sudden, the kanji has simply stopped working. When I hit the space bar to change kana into kanji, i just hear an error noise and nothing happens. It has been like this for a few days; restarting doesn't help. Does anyone know what could be wrong? I can't think of anything I have changed in the past few weeks.
    By the way, I am using a Macbook. And filevault is turned on, if that would change anything.
    Thanks in advance!
    Adam

    Hi, thanks for all of the help! But still no good...
    It still takes a long time to load, and when I hit the space bar, an error sound shows. No kanji pops up anymore. I wish I could remember what I have changed recently that would make it do this...
    Any other ideas?

  • Printing UTF-8 text via command line (i.e. 10.5-ready enscript for UTF-8)

    Hello,
    (I asked this question in the Leopard discussion section, but was advised to use this forum.)
    I am using some terminal-based tools like Alpine and Vim, both with UTF-8 text encoding. Printing, however, is a problem, because the UTF-8 characters are not correctly printed. For Alpine I use enscript, but it does not support UTF-8. (Currently I convert UTF-8 to latin1 first using iconv before sending it to enscript, but special characters get lost that way.) For Vim I use CUPS-PDF, a virtual PDF printer, but also here UTF-8 characters does not make it (even though CUPS-PDF works for UTF-8 in Cocoa apps).
    Paps as an alternative to enscript may work, but I don't want to spend much time currently installing all necessary libraries.
    I am wondering if I can use Leopard's printing natively. *Is there a command line tool ready for OS 10.5 that accepts UTF-8 text and converts it to PS/PDF or sends it directly to a selected printer queue?*
    Thanks!

    I think you can use enscript for 8 bit code. You just have to set the option. if you check the users guide you may be able to use an option to honor 8 bit code. I haven't tried it, but my .enscriptrc looks like
    cat .enscriptrc
    # GNU Enscript configuration file.
    # Author: Stanley Williams
    # Local Version
    # How characters greater than 127 are printed:
    # 1 generate clean 7-bit code; print characters greater than 127
    # in the backslash-octal notation `\xxx' (default)
    # 0 generate 8-bit code
    Clean7Bit: 1
    # Default input encoding.
    # DefaultEncoding: mac
    # Default output media.
    DefaultMedia: Letter
    # Media definitions:
    # name width height llx lly urx ury
    Media: Legal 612 1008 24 24 588 984
    Media: Letter 612 792 36 36 576 756
    # Pass following Page Device options to the generated output.
    # Duplex printing.
    SetPageDevice: Duplex:true
    Hope this helps.

  • SOA 10g - Convert string to MD5 hash

    Hi Guys,
    Is there a way apart from using Java to convert a string to MD5 hash in soa bpel process ?
    Thanks
    K

    Sorted it out, used java embedding and it worked, example below of java embedding
    String md5=getVariableData("md5Var").toString(); //this is the variable that needs to be md5 hashed
    try{              
    MessageDigest md = MessageDigest.getInstance("MD5");
    byte[] myByteArray1 = md5.getBytes("UTF-8");
    byte[] myByteArray2 = md.digest(myByteArray1);
    BigInteger bigInt = new BigInteger( 1, myByteArray2);
    String javahashedstring = bigInt.toString(16);
    setVariableData("md5Var", javahashedstring, false); //return md5 hashed variable
    }catch (Exception ex){     
    ex.printStackTrace();
    }

  • KDE apps and kanji

    hi,
    using XFCE actually but amarok is there too
    I noticed i can't see kanji symbols in amarok, but ONLY kanji. Other unicode symbols are ok.
    Katakana and hiragana are shown properly.
    The same situation is with ID3 tags and filenames when displayed by amarok.
    And yes both filename nad ID3 tags are 100% unicode.
    In terminal and applications like thunar filenames are displayed properly even with kanji.
    My locale is using utf8.
    Asked some of ppl i know and they had the same problem. Not only with amarok but other KDE apps too.
    So what could it be?
    Is it that KDE applications use fonts that can't display kanji yet can display katakana and hiragana?
    Makes no sense to me...
    Hope anyone knows the solution
    thx

    kiloecho7 wrote:
    Hey _saiko,
    I'm running XFCE on arch64, and am living in 熊本 right now so I deal with kanji on a daily basis.  Both kanji and kana work for me in Amarok (and everywhere else, for that matter), here are the instructions that I followed step by step in order to achieve it.
    http://wiki.archlinux.org/index.php/Scim
    I also had the following fonts installed by pacman:
    ttf-arphic-ukai
    ttf-arphic-uming
    ttf-dejavu
    ttf-fireflysung
    もしそうするとまだ漢字を見えなかったら、どうすればいい分かりません。
    many thanks
    after i installed the fonts amarok displays kanji too!
    the thing is... i didn't think fonts would be the problem since all my other applications successfully showed kanji with like.. default fonts
    tho... those kanji appear in amarok as if they really are from some other font
    actually... it's my font rendering that has problems...
    only those kanji and only in amarok... they appear as if they aren't rendered properly...
    here's a sshot:
    http://pub.insanity.in/img/scrshot/2008 … _scrot.png
    oh well :>
    well i'm not studying japanese or something... tho i might
    Last edited by _saiko (2008-02-01 23:48:52)

Maybe you are looking for

  • More Comfort for Syncing Aperture 2.0 Pictures to iPod

    hi, it would be great if the Project-container and the Album inside can selected like a Tree like the iTunes Playlists inside their Folders. Now i have to Scroll around 200 Pages down to find one Album. Or if i want to get all Photos from a Project i

  • Importing from my JVC GR-DV X4

    I have quiet an old DV camera. After plugging the camera to the firewire port, it seems impossible to import the video within iMovie using the import window. It does not come from my camera since it was working with my former PC ! I am a switcher an

  • OS X Mavericks 10.9.3 Crashes Too Often

    Hi, My iMac and MBP have been upgraded to OS X Mavericks 10.9.3. They crash too often. Ed

  • JAAS: Swing & Web implementation

    Hi, I want to use the JAAS mechanism in 2 applications: one of them is a swing application and the other is a web application. I would like to use the same interface for both applications. I implemented it in the "swing way": using my own callbackHan

  • UTF-8 ePub Display problems...

    The screen capture is self explaining... The table of contents on the left shows very well the romanian diacritics, while the contents displays only question marks! Tanks for help, regards, Mircea