GUI_UPLOAD and UNICODE or UTF-8

Hello,
I wanted to convert some files in SAP, i.e. :
- data is processed in MS Excell and saved as Unicode file
- I read the file into SAP, process the strings and write it back
The problem is that there are some special polish characters in the file. I read the file using GUI_UPLOAD FM, but I didn't manage not to have these special characters replaced (by # by default).
Anyone came across this problem before?
Regards,
Michal

Hello Satya,
Actually I forgot to write that I used the CODEPAGE parameter... I tried two cases:
1. Save as Unicode (in Excel or Notepad) and than use CODEPAGE = "4103"
2. Save as UTF-8 in Notepad and use CODEPAGE = "4110"
In both cases the polish caracters are replaced by '#'.
In fact I tried many other code pages (all from tcp00a), but all other combinations return an error.
Regards,
Michal

Similar Messages

  • Sql Plus and Unicode (or utf-8) characters.

    Hello,
    i have problem with Sql Plus and unicode files. I want to execute Start {filename}, where {filename} is file in unicode format (this file have to contains german and polish characters). But i receive error message. It is possible to read from unicode (or utf-8) file and execute commands from this file)?
    Thanks in advance.
    Pawel Przybyla

    What is your client operating system characterset?

  • GUI_UPLOAD and Unicode

    Hi,
    I want to use GUI_UPLOAD to load an ASCII file with Czech Characters. I try to save my file in .txt format UTF-8. If i read the file with notepad then i have all my characters but when i load in SAP I lost some characters - Who have a solution - I'm in 4.6C - I put in SAPlogon page code 1404 and language CS .
    DATA: BEGIN OF f1  OCCURS 0,            
          altkn(10)    TYPE c,
          bldat(10)     TYPE c,               "tt.mm.jj
          rart(15)     TYPE c,
    insert michel
          zuonr(18),
          xblnr(20)    TYPE c,
        name1(40)    TYPE c,
          waers(5)     TYPE c,
          brutt(13)    TYPE c,
          fwbtr(13)    TYPE c,
          faedt(10)    TYPE c,
          zterm(4)     TYPE c,
          kunnr(10)    TYPE c,
          sgtxt(49)    TYPE c, => i can find VANĚK
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = pcfil
       FILETYPE                      = 'BIN'
          has_field_separator           = fsepa
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
         CODEPAGE                      =  'UTF8'
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
          CHECK_BOM                     = 'X'
        IMPORTING
           filelength                    = rc
         HEADER                        =
        TABLES
          data_tab                      = f1
         EXCEPTIONS
          file_open_error               = 1
    Thanks

    Same problem - To keep all the accents, i must save in UTF-8 and i have the same problem with gui_upload.I've just seen that my function GUI_UPLOAD in this system (4.6C) is not the same than in 4.7 - Only these parameters for export -
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      =
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    I don't have the possibility to choose the codepage. Perhaps it's the reason ?

  • Perform unicode to UTF-8 conversion on F110 bacs payment file in ABAP

    Hi,
    I am facing a conversion issue for the UK BACS payment files.
    The payment run tcode F110 creates a payment file but the file when created on the application server has soem sort of code conversion. If I removed the # value, i can read most of the data.
    The data example is as below-
    #V#O#L#1#0#0#1#5#8#8# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #2#4#3#3#0#9#
    #H#D#R#1#A#2#4#3#3#0#9#S# # #1#2#4#3#3#0#9#0#0#0#0#0#2#0#0#0#1#0#0#0#1# # # # # # # #1#0#1#1#2#
    #H#D#R#2#F#0#2#0#0#0#0#0#1#0#0# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #U#H#L#1# #1#0#1#1#3#9#9#9#9#9#9# # # # #0#0#0#0#0#0#0#0#1# #D#A#I#L#Y# # #0#0#0# # # # # # # #
    This is then transferred to the bank via the FTP UNIX Script but after the conversion which is happening as-
    #Perform unicode to UTF-8 conversion on bacs file
    $a = "iconv -f UNICODE -t UTF-8 $tmpUNI > $tmpASC";
    The need going forward is to bring the details via the interface and then make an uplaod.
    The ABAP code should be able to make the conversion, remove the additional chracters and then send the file across.
    I have searched everywhere but I am not able to find out how to make the same conversion in ABAP.
    We are on ECC6.
    Can someone please help me?
    Regards,
    Archana

    Hi Archana,
    can  you please check SAP notes 1064779 and 1365764 (including the attachment) and see if this helps you ?
    Best regards,
    Nils Buerckel
    SAP AG

  • Gui_upload and  ws_upload

    hi friends,
    i have a small doubt i just want to know the difference betweeen
    GUI_UPLOAD and WS_UPLOAD which one i have to use.
    which function module is useful and  most preferred.
    regards
    srinivas

    WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
    The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.

  • Preparing for upgrade and Unicode conversion while on 4.6c

    We're currently on 4.6c and preparing to upgrade to ERP 2005 and do a Unicode conversion.  I'm trying to compile a list of coding techniques that can used in 4.6c that will minimize changes needed for Unicode.  Does anyone have such a list?
    Some things I've discovered reading about Unicode include:
    1) Use GUI_UPLOAD and GUI_DOWNLOAD rather than WS_UPLOAD and WS_DOWNLOAD.
    2) Structures or table headers that contain non-character data need to be identical when moving, comparing, selecting into, updating from, etc.  This includes not moving structures/tables with non-character data to a character field or vice-versa.
    3) Offsets can't cross non-character data.
    4) Assign statement with offset must specify a length.
    5) Open dataset must specify "FOR INPUT", "FOR OUTPUT", "FOR APPENDING", or "FOR  UPDATE".  It no longer defaults to FOR INPUT when omitted.
    6) Many implicit conversions from char to numeric are no longer allowed.  Use explicit conversion instead; such as the move statement.
    I know there are others.  Any help would be appreciated.
    Regards,
    Mark Perrey

    Hai Mark
    Check the following F.M Replacents
    Upgrade Error Details     Suggestions
    Function Module "DOCUMENT_REGISTRY_PROGRAM"not found in the target system     Suggest to replace this FM with the function module CV120_GET_APPL_FROM_REGISTRY.
    Function Module "RP_HIRE+FIRE"not found in the target system     Suggest to replace this FM with the function module RP_HIRE_FIRE .
    Function Module "ME_READ_HEADER_SINGLE" not found in the target system     Suggest to replace this FM with the function module ME_EKKO_SINGLE_READ.
    Function Module "ME_READ_ITEM_SINGLE" not found in the target system     Suggest to replace this FM with the function module ME_EKPO_SINGLE_READ.
    Function Module "RZL_ALERT_CONTROL" not found in the target system     Function Module "RZL_ALERT_CONTROL" is not available in the Enterprise Version. Suggest to use the function module "TH_SEND_ADM_MESS" to acheive the same functionality of "RZL_ALERT_CONTROL".
    Function Module "MM_SELECT_ADDRESS" not found in the target system     Suggest to replace this FM with the function module MM_SELECT_PARTNER.
    Function Module "MM_READ_ADDRESS" not found in the target system     Suggest to replace this FM with the function module MM_PARTNERS_FOR_MESSAGING
    Function Module "ME_VALUES_T161" not found in the target system     Suggest to replace this FM with the function module HELP_VALUES_BSART.
    Function Module "ME_VALUES_T024W" not found in the target system     . Suggest to replace this FM with the function module HELP_VALUES_WERKS.
    Function Module "SD_PACKING_REFRESH" not found in the target system     Suggest to replace this FM with the function module HU_PACKING_REFRESH.
    Function Module "SD_PACKING_RENAME" not found in the target system      Suggest to replace this FM with the function module V51P_PACKING_RENAME.
    Function Module "RV_EXPORT_CONTROL_UPDATE" not found in the target system     Suggest to replace this FM with the function module RV_EXPORT_CONTROL_UPD_PREPARE.
    Function Module "RV_INVOICE_COPY" not found in the target system     Suggest to replace this FM with the function module RV_SALES_DOCUMENT_COPY.
    Function Module "SD_SCHEDULE_AGREEMENT_PACKING" not found in the target system     Suggest to replace this FM with the function module HU_PACKING_SALES_PROPOSAL.
    Function Module "SERIAL_RENUM_WV" not found in the target system     Suggest to replace this FM with the function module IWOL_WV_SWITCH_NUMBER.
    Function Module "CUD0_DISPLAY_CONFIGURATION" not found in the target system     Suggest to replace this FM with the function module VC_I_DISPLAY_CONFIGURATION.
    Function Module "SD_PACKING_CREATE" not found in the target system     Suggest to replace this FM with the function module V51F_PACKING_CREATE.
    Function Module "FI_ARCHIVE_CHECK_DOC" not found in the target system     Function Module FI_ARCHIVE_CHECK_DOC is not available in the Enterprise Version. Suggest to replace this FM with the function module FI_DOCUMENT_ARCH_CHECK_DOCS.
    Function Module "OPEN_FI_CHECK" not found in the target system     Function Module OPEN_FI_CHECK is not available in the Enterprise Version. Suggest to replace this FM with the function module OPEN_FI_PERFORM_******_E.
    Function Module "SD_PACKING_UPDATE"not found in the target system     Function Module SD_PACKING_UPDATE is not available in the Enterprise Version. Suggest to replace this FM with the function module HU_PACKING_UPDATE.
    Function Module "F4_MACO" is being used in the program     Function Module "F4_MACO" is not available in the Enterprise Version. Since the Matchcode objects are not used in the Enterprise Version, Suggest to replace this FM with Search help's Value Request function module F4_SEARCH_HELP.
    Function Module "SWZ_AI_RELEASE_S" is used in the program     Suggest to use the function module "SWZ_AI_RELEASE" instead of "SWZ_AI_RELEASE_S".
    Function Module "SWW_WI_ORGTASK_READ" is  used in the program      Suggest to replace this FM with the function module RH_WI_ORGTASK_READ.
    Function Module "RH_READ_EXCEL_PATH" is being used in the program     Suggest to replace this FM with "RH_CHECK_EXCEL_SUPPORT".
    Function Module "RZL_ALERT_CONTROL" is used in the program     Function Module "RZL_ALERT_CONTROL" is not available in the Enterprise Version. Suggest to use the function module "TH_SEND_ADM_MESS" to acheive the same functionality of "RZL_ALERT_CONTROL".
    Function Module "CONVERT_TO_OTHER_CURRENCY" is used in the program     Suggest to ruse the function module "CONVERT_TO_LOCAL_CURRENCY" for currency conversion.
    Function Module "LOAN_TABLECONTROL_SCROLLING" is not available in the Enterprise Version.      Suggest to replace this FM with the function module SCROLLING_IN_TABLE.
    CALL FUNCTION 'DOWNLOAD' used in program is obsolete in target system.     "DOWNLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
    Suggest to use the unicode enabled methods
    FILE_SAVE_DIALOG and GUI_DOWNLOAD
    from class CL_GUI_FRONTEND_SERVICES.
    Note:
    However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to DOWNLOAD to the new GUI_DOWNLOAD functions."
    CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME' used in program is obsolete in target system.     "HELP_VALUES_GET_NO_DD_NAME function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
    Suggest to use the function module F4IF_INT_TABLE_VALUE_REQUEST in the target system."
    CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA' used in program is obsolete in target system.     "POPUP_TO_CONFIRM_LOSS_OF_DATA is obsolete in the target system.
    Suggest to use function module POPUP_TO_CONFIRM."
    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' used in program is obsolete in target system.     "POPUP_TO_CONFIRM_STEP is obsolete in the target system.
    Suggest to use function module POPUP_TO_CONFIRM."
    CALL FUNCTION 'WS_DOWNLOAD' used in program is obsolete in target system.     "WS_DOWNLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
    Suggest to use the unicode enabled GUI_DOWNLOAD function module.
    Note:
    However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to WS_DOWNLOAD to the new GUI_DOWNLOAD function."
    CALL FUNCTION 'WS_FILENAME_GET' used in program is obsolete in target system.     "WS_FILENAME_GET function module is obsolete, and results in errors on Unicode systems.
    Suggest to use FILE_OPEN_DIALOG und FILE_SAVE_DIALOG Unicode-enabled methods of the cl_gui_frontend_services class.
    Note:
    New applications should restart on these methods instead of the function module. The function module is extended by a Support Package so that it diverts calls to the methods without the application having to be changed."
    CALL FUNCTION 'WS_UPLOAD' used in program is obsolete in target system.     "WS_UPLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
    Suggest to use the unicode enabled GUI_UPLOAD function module.
    Note:
    However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to WS_UPLOAD to the new GUI_UPLOAD function."
    Function parameters EBENE, GRUPP, DATE_LOW, DATE_HIGH, BANKK. BUKRS, S_BUKRS, S_DISPW in function module CASH_FORECAST_TR_SELECT_ITEM is missing in the target system.     "Function Module CASH_FORECAST_TR_SELECT_ITEM is no longer used, instead it has been split based on the functionalities.
    Suggest to use function module
    1) CASH_FORECAST_PR_SELECT_ITEM for Payment Arrangements.
    2) For TR, WP, DA use function module CASH_FORECAST_TR_ITEM_2.
    The IMPORT and TABLES parameters of the above 2 function modules are almost same as CASH_FORECAST_TR_SELECT_ITEM.
    The IMPORT parameter BUKRS is not available in the above 2 function modules. Hence suggest to change the coding accordingly."
    Import parameter BUKRS in function CASH_FORECAST_LO_SELECT_ITEM is missing in the target system.     "Import parameter BUKRS in function CASH_FORECAST_LO_SELECT_ITEM is not available in the target system.
    Also the coding in Function Module based on the parameter BUKRS has been removed, instead the TABLES parameter S_BUKRS and S_GSBER has been used.
    Suggest to check the coding in the program accordingly.
    Import parameter BUKRS in function CASH_FORECAST_RE_SELECT_ITEM is missing in the target system.     "Import parameter BUKRS in function CASH_FORECAST_RE_SELECT_ITEM is not available in the target system.
    Also the coding in Function Module based on the parameter BUKRS has been removed, instead the TABLES parameter S_BUKRS and S_GSBER(new parameter) has been used.
    Suggest to check the coding in the program accordingly.
    Function Module HELP_VALUES_GET_WITH_MACO is obsolete in target system     Suggest to use F4IF_FIELD_VALUE_REQUEST
    Function Module G_OBJECT_GET is obsolete in target system.     Suggest to Use G_INTERVAL_GET_NEXT
    Function Module READ_COSTCENTER is obsolete in target system     Suggest to Use K_COSTCENTER_SELECT_SINGLE
    Function Module K_BUSINESS_PROCESS_READ_MULTI is obsolete or not available in target system     Suggest to Use K_PROCESSES_SELECT_TAB
    G_SET_AVAILABLE     Suggest to Use G_SET_GET_INFO
    Function Module G_SET_DOUBLE_CHECK is obsolete or not available in target system     "DO NOT CALL THIS FUNCTION MODULE
    FROM 4.0A VERSION ,THIS PROBLEM WILL NOT OCCUR"
    Function Module HELP_VALUES_GET is obsolete or not available in target system     Suggest to Use F4IF_FIELD_VALUE_REQUEST
    G_SELECT_SET     Suggest to Use G_SET_SELECT
    Function Module G_SET_AVAILABLE is obsolete or not available in target system     Suggest to Use G_SET_GET_INFO
    Function Module NAMETAB_GET is obsolete or not available in target system     Suggest to Use DDIF_FIELDINFO_GET
    Function Module DD_GET_DD03P is obsolete or not available in target system     Suggest to Use DDIF_FIELDINFO_GET / DDIF_TABL_GET
    CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE' used in program is obsolete in target system.     Suggest to use function module POPUP_TO_CONFIRM.
    CALL FUNCTION 'POPUP_TO_DECIDE' used in program is obsolete in target system.     Suggest to use function module POPUP_TO_CONFIRM.
    Function Module HELP_VALUES_GET_WITH_TABLE is obsolete or not available in target system     Suggest to Use F4TOOL_F4FUNCTION_BRIDGE
    Function Module CLPB_EXPORT is obsolete or not available in target system     "Suggest to Use Suggest to use the unicode enabled methods
    CLIPBOARD_EXPORT from class CL_GUI_FRONTEND_SERVICES."
    Function Module SAP_TO_ISO_MEASURE_UNIT_CODE is obsolete or not available in target system     Suggest to Use UNIT_OF_MEASURE_SAP_TO_ISO
    Regards
    Sreeni

  • Upgrade to ECC6 and Unicode: Passing HTML

    We are experiencing new issues related output on our Web page URL.
    Iu2019d like to convert the internal text table, t_html (now in Unicode-I assume utf-16), to contain the old hex values(I assume utf-8), before the Unicode upgrade. Or, convert the text table from utf-16 to utf-8.
    First, and most importantu2026.Is this possible?
    If so, I assume these are the steps I need to do, and am asking for suggestions::
    step 1) Transform internal table t_html to hex (so I can covert it from utf-16 to utf-8?)
    step 2) Convert the utf-16 hex values (Unicode) to utf-8 (old hex, non-unicode).
    step 3) Transform the converted t_html back to text so I can pass it out in its usual fashion.
    What would be the easiest approach (or not easiest approach, if necessary) to do this?
           I am open to any and all suggestions, this has been a struggleu2026.Thank-You
    Edited by: TMM on Oct 23, 2009 10:35 AM

    You mean hex stored as  string (0-F)?

  • Unicode or UTF-8?

    Hi, all,
    I'm developing a JSP application that will work with international characters, both displaying them on webpages and storing them in a MySQL database. I'm a bit confused about whether I should use Unicode or UTF-8 for those character strings. (I've read up on both of these encodings and they appear to be very similar in many respects.)
    Can anyone give me any suggestions as to which I should use and why?
    Thanks,
    Dmitri.

    UTF-16 uses 2 bytes for all characters.
    UTF-8 generally uses anywhere from 1 to 6 bytes toActually, UTF-16 uses 16-bit tokens, and represents characters with one or more tokens, like all UTF encodings.
    Generally, the encodings 'UTF-N' use N-bit tokens, and encode the 32-bit UNICODE scalar values (character set) with one or more tokens. Typically, the lower values in the encoding represent the UNICODE scalar values directly.
    UNICODE defines 'UTF-8', 'UTF-16', and 'UTF-32', the latter two in big- and little-endian forms as well as self-specifying forms (using initial bytes of a file or stream). 'UTF-32' encoding just uses the UNICODE scale values directly.
    There is also 'UTF-7', which is used in mime encoding to get through 7bit character sets. There are also unofficial 'UTF-6' etc for specialist use.
    UTF-8 has the advantage that it does not contain null (zero valued) bytes, which means that it works transparently with code expecting to see one byte characters (assuming the legacy code doesn't try to manipulate multi-byte characters!).

  • Character encoding (unicode to utf-8) conversion problem

    I have run into a problem that I can't seem to find a solution to.
    my users are copying and pasting from MS-Word. My DB is Oracle with its encoding set to "UTF-8".
    Using Oracle's thin driver it automatically converts to the DB's default character set.
    When Java tries to encode Unicode to UTF-8 and it runs into an unknown character (typically a character that is in the High Ascii range) it substitutes it with '?' or some other wierd character.
    How do I prevent this.

    my users are copying and pasting from MS-Word. My DB
    is Oracle with its encoding set to "UTF-8".Pasting where? Into the database? If they are pasting into the database (however they might do that) and getting bad results then that's nothing to do with Java.
    Using Oracle's thin driver it automatically converts
    to the DB's default character set.Okay, I will assume that is correct.
    When Java tries to encode Unicode to UTF-8 and it
    runs into an unknown character (typically a character
    that is in the High Ascii range) it substitutes it
    with '?' or some other wierd character.This is false. When converting from Unicode to UTF-8 there are no "unknown characters". I don't know what you mean by the "High Ascii range" but if your users are pasting MS stuff into your Java program somehow, then a conversion from something into Unicode is done at that time. If "something" isn't the right encoding then you have the problems already, before you try to write to the DB.
    How do I prevent this.First identify the problem. You have input coming from somewhere, then you are writing to the database. Two different steps. Either of them could have a problem. Test them separately so you know which one of them is the problem.

  • Purpose each of these is: Gui_upload and upload

    Hi Friends,
    Kindly let me know what the Exact Purpose each of these is: Gui_upload and upload
    What is the difference between those two?
    Akshitha.

    Hi,
    UPLOAD fm is the old function module which is now obsolete. From 4.6C onwards SAP has delivered new FM's for uploading and that is GUI_UPLOAD.
    the diff is  UPLOAD pops up a box during runtime to accept the file path the GUI_UPLOAD does not pop up any box during runtime instead takes the path as a paramter.
    This is what SAP HELP SAYS
    Files on the Presentation Server
    WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
    The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
    Instead of using the function modules, you can use the static methods GUI_UPLOAD and GUI_DOWNLOAD of the global class CL_GUI_FRONTEND_SERVICES.
    Cheers
    VJ
    Message was edited by:
            Vijayendra  Rao

  • What is diff in Open SQl and Unicode

    Hi.
    What is difference in Open SQl and Unicode.
    What are advantages of Unicode ?

    hi osk,
    <b>u cant compare open sql with unicode as both are different..</b>
    just a small explanation..
    <b>Open SQL</b> consists of a set of ABAP statements that perform operations on the central database in the R/3 System. The results of the operations and any error messages are independent of the database system in use. Open SQL thus provides a uniform syntax and semantics for all of the database systems supported by SAP. ABAP programs that only use Open SQL statements will work in any R/3 System, regardless of the database system in use. Open SQL statements can only work with database tables that have been created in the ABAP Dictionary
    <b>unicode</b>
    Data types such as CHAR ASCII and CHAR EBCDIC are mainly suited to English and central European languages. With other character sets, a code attribute is usually used for these data types. This code attribute uses a different presentation code to ASCII and EBCDIC, even for internal storage in the database system. This causes problems if you want to access these database systems using a different character set, or if you want to exchange data between database systems with different character sets.
    You can avoid these problems by using internal character coding in accordance with UNICODE. Internally, the UNICODE data is stored in UTF-16/UCS-2 format. In UTF-16/UCS-2 format, all characters are two bytes long.
    SAP DB is able to display various presentation codes in UNICODE format
    <b>please close the thread after rewarding the appropriate points...</b>
    Message was edited by: Ashok Kumar Prithiviraj

  • Japanese characters, outputstreamwriter, unicode to utf-8

    Hello,
    I have a problem with OutputStreamWriter's encoding of japanese characters into utf-8...if you have any ideas please let me know! This is what is going on:
    static public String convert2UTF8(String iso2022Str) {
       String utf8Str = "";
       try {          
          //convert string to byte array stream
          ByteArrayInputStream is = new     ByteArrayInputStream(iso2022Str.getBytes());
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          //decode iso2022Str byte stream with iso-2022-jp
          InputStreamReader in = new InputStreamReader(is, "ISO2022JP");
          //reencode to utf-8
          OutputStreamWriter out = new OutputStreamWriter(os, "UTF-8");
          //get each character c from the input stream (will be in unicode) and write to output stream
          int c;
          while((c=in.read())!=-1) out.write(c);
          out.flush();          
         //get the utf-8 encoded output byte stream as string
         utf8Str = os.toString();
          is.close();
          os.close();
          in.close();
          out.close();
       } catch (UnsupportedEncodingException e1) {
          return    e1.toString();
       } catch (IOException e2) {
          return e2.toString();
       return utf8Str;
    }I am passing a string received from a database query to this function and the string it returns is saved in an xml file. Opening the xml file in my browser, some Japanese characters are converted but some, particularly hiragana characters come up as ???. For example:
    &#23627;&#21488;&#39592;&#30000;&#23478;&#12399;&#26178;&#38291;&#30446;&#38626;&#12428;&#25312;&#12426;&#25152;&#37027;&#35207;&#24066;&#30690;&#30000;&#20124;&#24076;&#23376;&#12490;&#12479;&#12495;&#12450;&#12469;&#12459;&#12521;&#12510;&#26978;&#33865;&#12373;&#12510;&#12516;&#12450;
    shows up as this:
    &#23627;&#65533;?&#65533;&#39592;&#30000;&#23478;&#65533;?&#65533;&#26178;&#38291;&#30446;&#38626;&#12428;&#25312;&#12426;&#25152;&#37027;&#35207;&#24066;&#30690;&#30000;&#20124;&#24076;&#65533;?&#12490;&#12479;&#65533;?&#12450;&#12469;&#12459;&#12521;&#12510;&#26978;&#33865;&#65533;?&#65533;&#12510;&#12516;&#12450;
    (sorry that's absolute nonsense in Japanese but it was just an example)
    To note:
    - i am specifying the utf-8 encoding in my xml header
    - my OS, browser, etc... everything is set to support japanese characters (to the best of my knowledge)
    Also, I ran a test with a string, looking at its characters' hex values at several points and comparing them with iso-2022-jp, unicode, and utf-8 mapping tables. Basically:
    - if I don't use this function at all...write the original iso-2022-jp string to an xml file...it IS iso-2022-jp
    - I also looked at the hex values of "c" being read from the InputStreamReader here:
    while((c=in.read())!=-1) out.write(c);and have verified (using character value mapping table) that in a problem string, all characters are still being properly converted from iso-2022-jp to unicode
    - I checked another table (http://www.utf8-chartable.de/) for the unicode values received and all of them have valid mappings to a utf-8 value
    So it appears that when characters are written to the OutputStreamWriter, not all characters can be mapped from Unicode to utf-8 even though their Unicode values are correct and there should be utf-8 equivalents. Instead they are converted to (hex value) EF BF BD 3F EF BF BD which from my understanding is utf-8 for "I don't know what to do with this one".
    The characters that are not working - most hiragana (thought not all) and a few kanji characters. I have yet to find a pattern/relationship between the characters that cannot be converted.
    If I am missing some....or someone has a clue....oh...and I am developing in Eclipse but really don't have a clue about it beyond setting up a project, editing it and hitting build/run. It is possible that I may have missed some needed configuration??
    Thank you!!

    It's worse than that, Rene; the OP is trying to create a UTF-8 encoded string from a (supposedly) iso-2022 encoded string. The whole method would be just an expensive no-op if it weren't for this line:   utf8Str = os.toString(); That converts the (apparently valid) UTF-8 encoded byte array to a string, using the system default encoding (which seems to be iso-2022-jp, BTW). Result: garbage.
    @meggomyeggo, many people make this kind of mistake when they first start dealing with encodings and charset conversions. Until you gain a good understanding of these matters, a few rules of thumb will help steer you away from frustrating dead ends.
    * Never do charset conversions within your application. Only do them when you're communicating with an external entity like a filesystem, a socket, etc. (i.e., when you create your InputStreamReaders and OutputStreamWriters).
    * Forget that the String/byte[] conversion methods (new String(byte[]), getBytes(), etc.) exist. The same advice applies to the ByteArray[Input/Output]Stream classes.
    * You don't need to know how Java strings are encoded. All you need to know is that they always use the same encoding, so phrases like "iso-2022-jp string" or "UTF-8 string" (or even "UTF-16 string") are meaningless and misleading. Streams and byte arrays have encodings, strings do not.
    You will of course run into situations where one or more of these rules don't apply. Hopefully, by then you'll understand why they don't apply.

  • Help,DataInputStream and Unicode encoding problem

    Hello,everybody
    I am writing a small software for fun,but an problem about Unicode encoding stopped me. I tried to parse a file including integers,floats and Unicode characters(not UTF-8 but some other encoding type). I looked for the JDK documentation and I found that the class DataInputStream( implementing the interface DataInput) fitted my requirement best, then I tried but the Unicode characters are not read correctly( messy codes,only '????????').
    would you please help me? thanks a lot :-)

    the class DataInputStream has the methods useful to me, but find there is no method to set the encoding format ,both in DataInputStream and argument types used in its constructor:
    FileInputStream fis=new FileInputStream(fileName);
    DataInputStream     dis=new DataInputStream(fis);
    String line =dis.readLine();               System.out.println(line);
    // only "????????" output as result :-(
    I wonder how to set the encoding type,or another class.
    if I do it this way,it works,but there is no methods such as "readFloat","readInt",etc, so it's not what I want :
    FileInputStream fis=new FileInputStream(fileName);
    InputStreamReader read=new InputStreamReader(fis,"GB2312");
    BufferedReader reader=new BufferedReader(read);
    DataInputStream     dis=new DataInputStream(fis);
    String line = reader.readLine();
    System.out.println(line);
    thank you for your repley!

  • Difference between GUI_UPLOAD and WS_UPLOAD

    Hi,
    Please make me clear about the difference between GUI_UPLOAD and WS_UPLOAD. In which cases we need to use these modules...??
    Thanks,
    Satish

    I would suggest to always use the GUI_UPLOAD.  I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES.   Really, you should probably use the class/method instead of the function module.
      data: filename type string.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_upload
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf
             exceptions
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  no_authority            = 6
                  unknown_error           = 7
                  bad_data_format         = 8
                  unknown_dp_error        = 12
                  access_denied           = 13
                  others                  = 17.
    Regards,
    Rich Heilman

  • Combined Upgrade and Unicode conversion of Sap 4.6C to ECC6.0

    Hello all,
    my project team intends to carry out a combined upgrade and unicode conversion of an SAP ERP 4.6C system with MDMP to ECC6.0 (no enhancement package). The system is running on Oracle 10.2.
    In preparation for this upgrade, I have gone through the SAP notes 928729, 54801.
    We need to get a rough estimate of the entire downtime so as to alert our end users. From the CU&UC documentation in 928729, I read up note 857081. However the program in this note cannot be used to estimate the downtime as my system is < SAP netweaver 6.20.
    Is there any other SAP note or tool or program that I can use to estimate the downtime for the entire CU&UC? Thanks a lot!

    Hi,
    Combined upgrade depend upon number of factors like database size, resources on the server and optimization. In order to get idea of how much downtime, it will take, I would suggest you to do combined upgrade and unicode conversion on sandbox system which should be the replica of your production system. And try to optimize it. From there you can get approx. downtime required.
    Also, please read combined upgrade and unicode conversion guides on  http://service.sap.com/unicode@sap
    Thanks
    Sunny

Maybe you are looking for

  • Apple TV 1 - no manual sync anymore? Only Settings and Photos

    I still have an Apple TV 1 and I wanted to go transfer some stuff today but noticed that in the Devices it shows up but when you select it you only have 2 tabs - settings, which just tells you that it's a 32gb ATV etc and then a Photos tab. I want to

  • Removing non-alpha-numeric characters from a string

    How can I remove all non-alpha-numeric characters from a string? (i.e. only alpha-numerics should remain in the string).

  • Installing problem oracle 8.1.6 in RH 6.2 & SWAP problem

    halo everybody 1) i am having celeron machine with 32 MB RAM with four swap partition of 133MB each. i am trying to install oracle 8.1.6 for Red Hat linux 6.2. i have created mount point and required group/account. everything is finw. But while insta

  • TDS Base Amount

    Hi, Please anybody knows how the TDS base amount field is diplayed in TDS report i.e. tds amount, surcharge, edcess and from which field it should be picked from TDS tables? kumar

  • Star Schema....

    Hi, OBIEE 10.1.3.4 11r2 Database I have tables in the physical database that are in a parent child relationship, but both could be FACT tables in their own right. My parent has 1.8m ~ rows for a year. (Journal lines) - each line has a DR / CR amount