NATIVE CHARACTER(CHINEESE) INTO UTF-8

I AM SENDING NATIVE CHARACTER AS A QUERY STRING BUT THIS STRING IS NOT DISPLAYED AS UTF-8 FORMAT.
EXAMPLE
http://localhost:7001/test/tset1.jsp?usname=chinese charcter
this chinese character is not pickking up correctly

You should escape everything in a URL. Use java.net.URLEncoder.

Similar Messages

  • Character set conversion UTF-8 -- ISO-8859-1 generates question mark (?)

    I'm trying to convert an XML-file in UTF-8 format to another file with character set ISO-8859-1.
    My problem is that the ISO-8859-1 file generates a question mark (?) and puts it as a prefix in the file.
    ?<?xml version="1.0" encoding="UTF-8"?>
    <ns0:messagetype xmlns:ns0="urn:olof">
    <underkat>testv���rde</underkat>
    </ns0:messagetype>
    Is there a way to do the conversion without getting the question mark?
    My code looks as follows:
    public class ConvertEncoding {
         public static void main(String[] args) {
              String from = "UTF-8", to = "ISO-8859-1";
              String infile = "C:\\temp\\infile.xml", outfile = "C:\\temp\\outfile.xml";
              try {
                   convert(infile, outfile, from, to);
              } catch (Exception e) {
                   System.out.println(e.getMessage());
                   System.exit(1);
         private static void convert(String infile, String outfile,
                                            String from, String to)
                             throws IOException, UnsupportedEncodingException
              //Set up byte streams
              InputStream in = null;
              OutputStream out = null;
              if(infile != null) {
                   in = new FileInputStream(infile);
              if(outfile != null) {
                   out = new FileOutputStream(outfile);
              //Set up character streams
              Reader r = new BufferedReader(new InputStreamReader(in, from));
              Writer w = new BufferedWriter(new OutputStreamWriter(out, to));
              /*Copy characters from input to output.
               * The InputSreamreader converts
               * from Unicode to the output encoding.
               * Characters that cannot be represented in
               * the output encoding are output as '?'
              char[] buffer = new char[4096];
              int len;
              while((len = r.read(buffer))!= -1) { //Read a block of output
                   w.write(buffer, 0, len);
              r.close();
              w.flush();
              w.close();
    }

    Yes the next character is the '<'
    The file that I read from is generated by an integration platform. I send a plain file to it (supposedly in UTF-8 encoding) and it returns another file (in between I call my java class that converts the characterset from UTF-8 to ISO-8859-1). The file that I get back contains the '���' if the conversion doesn't work and '?' if the conversion worked.
    My solution so far is to skip the first "junk-characters" when reading from the inputstream. Something like:
    private static final char UTF_BOM = '\uFEFF'; //UTF-BOM = ?
    String from = "UTF-8", to = "ISO-8859-1";
    if (from != null && from.toLowerCase().startsWith("utf-")) { //Are we reading an UTF encoded file?
    /*Read first character of the UTF-Encoded file
    It will return '?' in the first position if we are dealing with UTF encoding If ? is returned we skip this character in the read
    try {
    r.mark(1); //Only allow to read one char for the reset function to work
    char c;
    int i = r.read();
    c = (char) i;
    if (String.valueOf(UTF_BOM).equalsIgnoreCase(String.valueOf(c))) {
    r.reset(); //reset to start position
    r.skip(1); //Skip first character when reading from the stream
    else {
    r.reset();
    } catch (IOException e) {
    e.getMessage();
    //return null;
    }

  • Is BPEL supports writing character data into binary format  ?

    Hello,
    I can write a BLOB data from DB to a file using Opaque feature in File Adapter.
    But is it possible to write Character data into Binary or Hex Format either by using base64Binary or Hex or bytes formats supported in XML?
    Thanks

    I am looking WHOLE FORMA DATA in either XSTRING or BINARY FORMAT or any other format, except STRING format.
    I gave COUNTRY as an example, but am looking the HWOLE form AS IS
    Any help pls.
    Thank you   

  • Oracle 11gr2 - change character set from utf-8 to weiso8859p15

    Hi guys,
    I've a new and empty oracle 11gr2 database for my test environment, during the installation i've choosed the UTF-8 character's set but now i've see that in the production environment there is the WEISO8859 character's set.
    I have a dump of the prod. env. (done with Exp function).
    How can I change the character set from utf-8 to weiso8859p15 ?
    I found this procedure:
    SHUTDOWN IMMEDIATE or a SHUTDOWN NORMAL;
    STARTUP MOUNT;
    ALTER SYSTEM ENABLE RESTRICTED SESSION;
    ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
    ALTER SYSTEM SET AQ_TM_PROCESSES=0;
    ALTER DATABASE OPEN;
    ALTER DATABASE NATIONAL CHARACTER SET new_character_set;
    SHUTDOWN IMMEDIATE; -- or SHUTDOWN NORMAL;
    STARTUP;
    is it correct ?
    Thx.
    Kind Regards,
    Stefano.

    evil.stefano wrote:
    Hi guys,
    I've a new and empty oracle 11gr2 database for my test environment, during the installation i've choosed the UTF-8 character's set but now i've see that in the production environment there is the WEISO8859 character's set.
    I have a dump of the prod. env. (done with Exp function).
    How can I change the character set from utf-8 to weiso8859p15 ?
    I found this procedure:
    SHUTDOWN IMMEDIATE or a SHUTDOWN NORMAL;
    STARTUP MOUNT;
    ALTER SYSTEM ENABLE RESTRICTED SESSION;
    ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
    ALTER SYSTEM SET AQ_TM_PROCESSES=0;
    ALTER DATABASE OPEN;
    ALTER DATABASE NATIONAL CHARACTER SET new_character_set;
    SHUTDOWN IMMEDIATE; -- or SHUTDOWN NORMAL;
    STARTUP;
    is it correct ?NO
    leave the character set alone.
    UTF-8 will not be a problem.

  • Reducing 6 character string into 2 character string

    --- So here's part 2 of my problem / This is the follow-up to my previous question ---
    --- part 1 of this question is "merging characters into one cell, keeping the order" ---
    How can I reduce a 6 character string into the right 2 character string ?
    guidelines :
    - the 6 character string is made up of up to 3 different characters, being A B C
    - all 6 character strings list As first, Bs second and Cs third
    - if the 6 character string contains 4 or more of the same characters, it should be reduced into a 2 character string of 2 times that same character
    e.g. AAAABC --> AA
    - if the 6 character string is AABBCC, then it should be reduced to the 'exception-string' NO
    e.g. AABBCC --> NO
    - if the 6 character string contains exactly 3 of the same characters, it should be reduced into a 2 character string of the 2 characters that occur most
    e.g. ABBBCC --> BC
    How do I fit this into just one formula ?
    Thanks !

    "I was actually thinking about something like :
    if ?????? = AABBCC, then NO,
    else : if ?????? contains A, B and C,..."
    I thought about that awhile and investigated a few dead ends before thinking 'Wait a minute...there are only 28 possible 6 character strings.'
    With that low number, the simplest solution is to list them in one column, list the two character result beside each one, then use that as a Lookup Table:
    Same table as before.
    Column L uses my version of Yvan's formula to produce the string from the entries in columns A,B and C
    Column Q uses the string in L as the search key for VLOOKUP to find and return the two character string shown.
    Q2: =VLOOKUP(L,Table 2 :: A:B,2,FALSE)
    "FALSE" sets the formula to look for an exact-match. Probably unnecessary here, as all possible matches are in Table 2. Here is the top part of that table:
    For convenience, here's the full data list for Table 2. Copy and Paste into a new table for your own use.
    6 char
    2 char
    AAAAAA
    AA
    AAAAAB
    AA
    AAAAAC
    AA
    AAAABB
    AA
    AAAABC
    AA
    AAAACC
    AA
    AAABBB
    AB
    AAABBC
    AB
    AAABCC
    AC
    AAACCC
    AC
    AABBBB
    BB
    AABBBC
    AB
    AABBCC
    NO
    AABCCC
    AC
    AACCCC
    CC
    ABBBBB
    BB
    ABBBBC
    BB
    ABBBCC
    BC
    ABBCCC
    BC
    ABCCCC
    CC
    ACCCCC
    CC
    BBBBBB
    BB
    BBBBBC
    BB
    BBBBCC
    BB
    BBBCCC
    BC
    BBCCCC
    CC
    BCCCCC
    CC
    CCCCCC
    CC
    Regards,
    Barry

  • Passing 900 character value into a Single line

    Hi Experts,
    I have a scenario that i have to pass 900 character value to a single field. After that i need to download this internal table into an text file.
    What happening after some characters the values are not getting passed into my varaibale.
    So please help me how to accomodate all the 900 character values in a single field.
    With Regards,
    Sumodh.P

    Hi,
       Chk this ...
    DATA : BEGIN OF IT_ITAB900 OCCURS 0,
             VAL(900) TYPE C,
           END OF IT_ITAB900.
    INITIALIZATION.
    CONCATENATE 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
    INTO
    IT_ITAB900-VAL.
    APPEND IT_ITAB900.
    START-OF-SELECTION.
    DATA : P_FILENAME TYPE  STRING.
    P_FILENAME = 'C:\Documents and Settings\testingis on.txt'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    = BIN_FILESIZE
        FILENAME                        = P_FILENAME
      TABLES
        DATA_TAB                        = IT_ITAB900 .
    This writes all the characters ....
    Regards,
    Srini.

  • How can I insert C structures that have character pointers into DBD file

    Hello~
    I am changing from a file system I made into DBD.
    And I had no choice to convert structures that have character point members
    to insert them into the DBD file
    for examble,
    If there is a structure as below
    typedef struct
    int IndexKey;
    int groupID;
    char* name;
    char* pNum;
    char* pAddr;
    char* pMemo;
    } TsomeRec;
    I made a structure to convert as below
    typedef struct
    int IndexKey;
    int groupID;
    char name[MAX_NAME_LEN];
    char pNum[MAX_NUM_LEN];
    char pAddr[MAX_ADDR_LEN];
    char pMemo[MAX_MEMO_LEN];
    } TsomeRec2;
    But, there are too many structures to convert.
    So, I am seeking for the most efficient way to insert these structures into DBD files, considering Performance.
    Frankly speaking, I'am not proficient.
    please describe as specific as possible.
    Thank you~

    Hi,
    Review the documentation section title Using C Structures with DB, in particular the subsection called C Structures with Pointers. It will explain the way to store structures that have pointers.
    Regards,
    Andrei

  • Change character encoding from UTF-8 to EUC-KR

    We are receiving data in UTF-8 in the querystring from a partner formatted as:
    %EA%B3%A0%EB%AF%BC%ED%95%98%EC%9E%90%21
    Our site uses EUC-KR so using this text for search/display/etc is not possible. Does anyone know how we can convert this to the proper Korean EUC encoding so it can be displayed properly using JSP? Basically it should be:
    %B0%ED%B9%CE%C7%CF%C0%DA%21
    Thanks in advance.

    I'm not sure where you are getting %xx encoded UTF-8.... Is it cuz you have it in a GET method form and that's what you are seeing in the browser's location bar? ...
    Let's assume you have a form on a page, and the page's charset is set to UTF-8, and you want to generate a URL encoded string (%xx format, although URLEncoder will not encode ASCII chars that way...).
    In the page processing the form, you need to do this:
    request.setCharacterEncoding("UTF-8"); // makes bytes read as UTF-8 strings(assumes that the form page was properly set to the UTF-8 charset)
    String fieldValue = request.getParameter("fieldName"); // get value
    // the value is now a Unicode String in Java, generated from reading the bytes submitted from the form as UTF-8 encoded text...
    String utf8EncString = URLEncoder.encode(fieldValue, "UTF-8");
    // now utf8EncString is a URL encoded (%xx) string of UTF-8 values
    String euckrEncString = URLEncoder.encode(fieldValue, "EUC-KR");
    // now euckrEncString is a URL encoded (%xx) string of EUC-KR valuesWhat is probably screwing things up for you mostly is this:
    euckrValue = new String(utf8Value.getBytes(), "EUC-KR");
    What this does is takes the bytes of the string utf8Value (which is not really UTF-8... see below) in the local encoding (possibly Cp1252 (Windows) or ISO8895-1 (Linux), or EUC-KR if it's Korean Windows), and then reads them as if they were EUC-KR... which they aren't.
    The key here is that Strings in Java are not of any encoding. They are pure Unicode values. Encodings only matter when converting to or from bytes. The strings stored in a file or sent over the net have to convert to bytes since that's what is stored/sent, just bytes. The encoding defines how the characters can be encoded into 1 or more bytes, and thus reconstructed.

  • How to set the system default file character encoding to UTF-8?

    Hi all. This is driving me nuts, on both my Windows box and Snow Leopard; I figure much more chance of finding the answer for OS X.
    My language and locale are set to Australian English. $LANG=en_AU.UTF-8
    However, as I believe is expected, OS X (and Windows for that matter) will create files by default with character encoding of Cp1252 (Latin-1). That is, the FILE encoding in the file metadata - the Byte Order Mark I believe. The file itself, not the characters written to it.
    This, in a word, bites. I don't want to be restricted to only ASCII by default, and it is causing me problems with certain software (a Firefox plugin) that creates text files, passing in UTF-8 encoded content, which is then mangled because the file encoding itself is still Cp1252. (I know, I've tested this by changing the file encoding manually and having it overwritten again by the plugin: works correctly.)
    As a simple example, just `touch somefile` from terminal creates a file in Cp1252 -- I'm obtaining that info by opening in jEdit by the way (anyone know of something better?).
    In other locales that are not English-based, I believe the default file encoding is UTF-8. But surely this can be controlled independently? There must be a system configuration value somewhere that specifies file encoding default. Can someone please tell me what it is?
    Thanks!

    However, as I believe is expected, OS X (and Windows for that matter) will create files by default with character encoding of Cp1252 (Latin-1). That is, the FILE encoding in the file metadata - the Byte Order Mark I believe. The file itself, not the characters written to it.
    Apps like TextEdit and Mail have settings that let you determine the encoding of text produced. The default would normally depend on the character content of the file, ranging from ASCII for basic English to Windows Latin-1 (Win 1252) or ISO Latin -1 (ISO 8859-1) to UTF-8 for other content.
    Win 1252 is not ASCII, but has twice the number of characters in the latter.
    Byte Order Mark is something totally different --it's a particular character used to signal certain encodings.
    http://en.wikipedia.org/wiki/Byteordermark
    As a simple example, just `touch somefile` from terminal creates a file in Cp1252 -- I'm obtaining that info by opening in jEdit by the way (anyone know of something better?).
    For what Terminal does and how to change it, it might best to post in the Unix forum:
    http://discussions.apple.com/forum.jspa?forumID=735
    For problems with a FireFox plugin, it might be good to ask on their own forums as well.

  • c:import character encoding problem (utf-8)

    Aloha @ all,
    I am currently importing a file using the <c:import> functionallity (<c:import url="module/item.jsp" charEncoding="UTF-8">) but it seems that the returned data is not encoded with utf-8 and hence not displayed correctly. The overall file header is:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Set-Cookie: JSESSIONID=E67F9DAF44C7F96C0725652BEA1713D8;
    Content-Type: text/html;charset=UTF-8
    Content-Length: 6861
    Date: Thu, 05 Jul 2007 04:18:39 GMT
    Connection: close
    I've set the file-encoding on all pages to :
    <%@ page contentType="text/html;charset=UTF-8" %>
    <%@ page pageEncoding="UTF-8"%>
    but the error remains... is this a known bug and is there a workaround?

    Partially, yes. It turns out that I created the documents in eclipse with a different character encoding. Hence the entire document was actually not UTF-encoded...
    So I changed each document encoding in Eclipse to UTF and got it working just fine...

  • Why is a special character  inserted into my drafts?

    After I save a draft, and then return later to finish it.... I frequently (more times than not) find that Thunderbird has inserted a ton of  characters in the email, all over. Usually at the end of every sentence. Often the are 3 in a row, with spaces between:   Â
    My Character Encoding, inbound and outbound: Weatern ISO-8859-1
    Any thoughts? Thank you kindly.

    I've been having the same problem recently. Checked the character encoding and it was set for utf-8. After several tests, I found that setting incoming and outgoing encoding to Western ISO-8850-1 solved the problem.

  • ABAP Native SQL error: "INTO ..." not specified. OO context no longer supported.

    FUNCTION Z_RAMZY1.
    dear I am working with ABAP (new developer)
    SAP ECC 6
    i am trying to create SQL Native and i am facing this error: ""INTO ..." not specified. OO context no longer supported."
    i know SQL Open but i want to try the native mode too.
    thanks,
    *"*"Local Interface:
    DATA: BEGIN OF GetData,
            FKDAT1(10) Type N,
            Month Type I,
            Year Type I,
            Day Type I,
            LowerName(100) TYPE C,
          END OF GetData.
    EXEC SQL PERFORMING LOOP_OUTPUT.
    Select Top 1000
      FKDAT as FKDAT1,
      Month(FKDAT) as [Month],
      Year(FKDAT) as [Year],
      Day(FKDAT) as [Day],
      Lower(ERNAM) as LowerName
      INTO: GetData
    From VBRK
    Where (Month(FKDAT) = 2)
    ENDEXEC.
    FORM loop_output.
      WRITE: / GetData-FKDAT1, GetData-Month, GetData-Year, GetData-Day, GetData-LowerName.
    ENDFORM.

    i did this :
    wa-fieldname = 'Month '.
    wa-seltext_m = 'nMonth '.
    APPEND wa TO fieldcatalog.
    CLEAR wa.
    * "2
    wa-fieldname = 'Year '.
    wa-seltext_m = 'nYear'.
    APPEND wa TO fieldcatalog.
    CLEAR wa.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        IT_FIELDCAT = fieldcatalog
      TABLES
        T_OUTTAB    = GetData.
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    the result is empty.
    it returns the columns but the result is empty.
    please advise.
    thanks,

  • Convert file format into UTF-8 while generating text file on FTP server

    Hi Expert,
    I have the requirement to generate text file store it in FTP server and file format should be in UTF-8.
    ABAP Development is completed but text file format generate in ANSI which not acceptable by client.For generating text file and store it on FTP server by using standard function module FTP_R3_TO_SERVER ,but in this function module there is no any parameter option like CODEPAGE for file format conversion. Is there any method or any function module to convert file format to UTF-8 and directly transfer or store it on FTP server.
    <<removed_by_moderator>>
    Thanks ,
    Edited by: Vijay Babu Dudla on Jan 28, 2009 12:48 AM

    I have come across the same issue.  Try calling the FTP_COMMAND function module to make it go into ASCII mode before your FTP the file, like this:
    data: result type table of text with header line.
    call function 'FTP_COMMAND'
        exporting
          handle        = hdl
          command       = 'ascii'
        tables
          data          = result
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3.
      call function 'FTP_R3_TO_SERVER'
        exporting
          handle         = hdl
          fname          = docid
          character_mode = 'X'
        tables
          text           = gt_your_table .

  • The Tilda character inserts into my text without keyboard input.  Or any input.  Has anyone seen this?

    When I have an AI file open and in the text mode.  The Tilda character "~" is inserted into the text string every few minutes.  I can go away and when I come back there will be 20 "~" all in a row.  Is there any cure?

    tci,
    You may try the list, unless there is something wrong with the Tilde key (hanging or something).
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save curent artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Pause after every character typed into title text

    Typing text into title delays for 3 seconds after each character typed.
    The best work around I found was to type the text into textedit and paste once done.
    Any other suggestions?

    Is 4 the maximum number of characters that can be entered?
    Then the solution is easy:
    - set the maximum lenght property of the item to '4'
    - set the automatic skip property to 'YES'
    I hope this helps...

Maybe you are looking for

  • Error when trying to start Elements 9/

    Question!  Get error message after instaling Elements9, & try to start. Message reads, PhotoShop cannot start or continue because of missing file(s). Please reinstall. I have reinsalled many times & always get the same message when I try to start the

  • Preview in Yosemite has lost option to print multiple images on a single page?

    I used to be able to select all thumbnails from sidebar in Preview, then print them on a single page - the options went from 2 up to 16 images per page I think.  This seems no longer an option.  Am I missing something?

  • Beginer-Problem with onNavigation

    Hi together, I have copied from here a example of calling a bapi and fill a table via ConnectionFactory. I have a problem with the event onNavigation. The showing of the next page or next line didn't work. I build another with JCo that works fine. He

  • New I Mac- safari does not show the URL window- help!

    My safari does not show the website address window, but everyone else in the family shows it. How do I fix this so that I can view the address window. Thanks.

  • Newbi question about Extend...

    I have just started to look into using Extend to develop some developer utility tools. When reading the documentation it is not clear to me if a cache (lets say a near cache) can be accessed BOTH by extend clients and cluster members and in that case