Decoding the content (text/plain) for charset "iso-2022-jp"

Hi there,
I am using IMAP protocol to receive new email message and retrieving the contents using java mail API InputStream is = p.getInputStream()
The part content type is text/plain and text/html and charset is "iso-2022-jp"
The contents contain Japanese Characters as well. In my code, I am decoding the contents using charset "iso-2022-jp" to get the actual content (verified by sending the same content using SFTP client built on java mail APIs). The contents are decoded properly in Linux OS but not working properly on Windows OS.
Can anybody help me out the root cause of this problem? The code snippet is as follows
InputStream is = p.getInputStream();// p is Part object
               byte[] bytesJap = IOUtils.toByteArray(is); // org.apache.commons.io.IOUtils
               String decodedBytesJap = decodeBytes(charset, bytesJap);
The content I am getting while deploying the program
on Linux box:
Subject: FW: Japanese characters
聖書に示された神の純粋なみ言葉に基づいて
on Windows box:
Subject: FW: Japanese characters
$B@;=q$K<($5$l$??@$N=c?h$J$_8@MU$K4p$E$$$F(B&
----------------------------------------------

decodeBytes() method implementation is as below
protected String decodeBytes(String characterset, byte[] bytes) throws CharacterCodingException
          CharsetDecoder decoder = null;
          try {
               decoder = Charset.forName(characterset)
                         .newDecoder();
          } catch (IllegalCharsetNameException e) {
          } catch (UnsupportedCharsetException e) {
          decoder.onMalformedInput(CodingErrorAction.REPORT);
          decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
          try {
               return decoder.decode(ByteBuffer.wrap(bytes)).toString();
          catch (CharacterCodingException e) {
               throw e;               
}

Similar Messages

  • How to change the Content-Transfer-Encoding for the fmddataa.fmd from base

    Dear all,
       When I using this SO_DOCUMENT_REPOSITORY_MANAGERto send email,I find the fmddata.fmd  file have been changed  to binary file attachment. I don't hope so.any one have good idea to avoid this case occur?
      Can you tell me how to change the Content-Transfer-Encoding for the fmddata.fmd from base64 to quoted-printable.  The quoted-printable is the Content-Transfer-Encoding for text file with extension .txt
    Best Regards,
    Merry

    Thank you

  • [svn] 3148: You can now use CSS styles to set the default text format for TextView.

    Revision: 3148
    Author: [email protected]
    Date: 2008-09-08 15:01:15 -0700 (Mon, 08 Sep 2008)
    Log Message:
    You can now use CSS styles to set the default text format for TextView. It no longer has any formatting properties. It supports the entire set of Gumbo text format styles.
    SkinnableComponent and Group now also support all these styles. However, skins such as ButtonSkin, TextInputSkin, and TextAreaSkin continue for now to specify instance styles on their TextBox, TextGraphic, and TextView, in order to give them a Gumbo look rather than a Halo look. So if you try setting, for example, the fontSize on the Application, it doesn't yet affect the text format of a Button, TextInput, TextArea, etc. unless you remove the instance style in the skin.
    Reviewer: Glenn
    Bugs: -
    QA: Lots of new stuff to test!
    Doc: No
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextBox.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextGraphicEle ment.as

    Nevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
    Thanks for taking a look though!
    Shaun

  • Where can I find the appropriate text string for China Time zone?

    Hi,
    Where can I find the appropriate text string for China Time zone?

    Hi,
    The following timezone strings are supported in Oracle8i 8.1.7:
    AST, ADT: Atlantic Standard or Daylight Time
    BST, BDT: Bering Standard or Daylight Time
    CST, CDT: Central Standard or Daylight Time
    EST, EDT: Eastern Standard or Daylight Time
    GMT: Greenwich Mean Time
    HST, HDT: Alaska-Hawaii Standard Time or Daylight Time.
    MST, MDT: Mountain Standard or Daylight Time
    NST: Newfoundland Standard Time
    PST, PDT: Pacific Standard or Daylight Time
    YST, YDT: Yukon Standard or Daylight Time
    Since your's isn't one of these, I'm hoping this is in reference to the Web Agent's ORDWEBUTL package, in which case, you can use an offset from GMT instead. For example, here in New Hampshire, USA, we are 5 hours behind GMT, so the offset would be -5, while in France, it would be +1 as they are one hour in front of GMT. According to my Windows clock, Beijing is GMT +8. Of course, you'll have to figure daylight-savings time into the equation, if you have to deal with such changes.
    Regards,
    Simon
    null

  • Problem in storing JAPANESE character in DB 10g charset iso-2022-jp

    All,
    I have problem in storing data in Db.
    I used page directive in JSP like
    <%@ page contentType="text/html; charset=iso-2022-jp"%>
    in jsp screen in will get JAPANESE character but in DB I found some JUNK but reteriving the same in jsp it shows correct JAPANESE character...
    Any one help me please.
    I used Hibernate
    Thanks and Regards
    Babu

    Hai John..Thanks for ur reply.
    In DB NLS_CHARACTERSET is JA16SJIS.
    Want to change it?
    Please guide me.
    Thanks in advance.
    Babu

  • What are the content conversion parameters for this structure

    Hi All,
    The below file is the text file. what are the content conversion parameters are required and what is the structure to create in the IR to convert into xml.
    Schedule D - District/Port List (by District Code) [Produced13APR11]
    District |    Port      |    Name
    Code     |    Code      |
    01       |              |    PORTLAND, ME
             |    0101      |    PORTLAND, ME
             |    0102      |    BANGOR, ME
             |    0103      |    EASTPORT, ME
             |    0104      |    JACKMAN, ME
             |    0105      |    VANCEBORO, ME
             |    0106      |    HOULTON, ME
             |    0107      |    FORT FAIRFIELD, ME
             |    0108      |    VAN BUREN, ME
             |    0109      |    MADAWASKA, ME
             |    0110      |    FORT KENT, ME
             |    0111      |    BATH, ME
             |    0112      |    BAR HARBOR, ME
             |    0115      |    CALAIS, ME
             |    0118      |    LIMESTONE, ME
             |    0121      |    ROCKLAND, ME
             |    0122      |    JONESPORT, ME
             |    0127      |    BRIDGEWATER, ME
             |    0131      |    PORTSMOUTH, NH
             |    0132      |    BELFAST, ME
             |    0152      |    SEARSPORT, ME
             |    0181      |    LEBANON AIRPORT
             |    0182      |    MANCHESTER USER FEE AIRPORT, NH
    02       |              |    ST. ALBANS, VT
             |    0201      |    ST. ALBANS, VT
             |    0203      |    RICHFORD, VT
             |    0206      |    BEECHER FALLS, VT
             |    0207      |    BURLINGTON, VT
             |    0209      |    DERBY LINE, VT
             |    0211      |    NORTON, VT
             |    0212      |    HIGHGATE SPRINGS/ALBURG

    since in this case you dont seem to have a key value to figure out what your header is, it is better to go for a two level mapping. i.e first read all the data - each line as an xml tag. and in the first mapping group it as required and then use it for your original mapping.
    Regards,
    Ninu

  • Middle-of-the-night text alerts for data usage - can I set alerts to email only?

    Can't seem to find how to turn OFF text alerts for data overage, but leave email alerts in effect. OR, is there a way to specify WHEN text alerts are sent? Seems every one I've received comes in between 1 and 3 AM EST.

    i'm also having major CPU problems w/ FF 29.0.1. when i restart the app it calms down again but after loading tabs it steadily climbs up to 100% after not too long. i have checked out the 2 CPU links/articles above and do all the basic troubleshooting and tips, but with all the FF tools & add-ons isn't there some sort of CPU monitor that has the ability to display which extensions/scripts are hogging the CPU? Activity Monitor on Mac just shows the total used by the app. it's impossible in my case to efficiently disable dozens of add-ons & scripts, restart, and test each one by one b/c it can take several hrs before the CPU starts to spike high again. i have no time for this.
    thanks

  • What is the "Content" DVD used for in CS5 Master Collection?

    Hey Everybody,
    Sorry--I know there must be some cue I am over looking somewhere, but what is the Contents DVD fo in the 4 disk CS5 Master Collection Installation Pack?  I have installed everything on a new MacBook Pro.  First 3 DVDs are very logical (in terms of what they contain and how to install them), but the 4th one just has a bunch or read-me files in various languages.  Is there something on this disk I need to install?
    Many thanks in advance!

    Just some templates and other assorted stuff. Nothing you have to have.
    Bob

  • Can I change the overall text size for the app interface...NOT the titler

    How can I increse the font size globally for all panels?? I need to make it larger I have looked for the answer, is there one...Coming from FCP which is easily changed, please help these old eyes! Thanks   CS5 on a Mac

    As time goes on, PP might just have all the things I love about FCP along with all the things I love about PP..... I hope Apple(they probably never come here) would take note of the steps Adobe take to listen to their customers. The one other thing I noticed is that premier's time indicator moves way too sensitively even when snapping is selected. They might wanna.............................they might wanna make it so i can right-click and send to a feature request form. I'm getting tired of opening that page. Never the less submitted.

  • Please help! How can I change the font / text size for the checkout page? I asked Support and they sent me here- thanks in advance for your response.

    Hello everyone! I build an e-commerce shopping cart via BC and integrated it with a muse website as seen at sarahcosmetics .com
    Everything is great, but my clients clients are complaining they cannot see the text well once they're in the checkout page.
    I was able to enlarge the font in my Registration-Buy form in the Online Shop Layouts / Module Templates under the Site Manager. This helped enlarge the font size in the checkout form however my issue arrises on the next page when they have to enter their details like CC information name, address etc. the font is way too small and I'm not sure where to access the tools to enlarge that.
    If you could PLEASE help I would greatly appreciate it. I told my client I would handle it asap and I have no idea how to fix this.
    Thank you in advance for your help.
    Jessica

    This isn't possible yet in the current version of Fennec, but we are working on it. See https://bugzilla.mozilla.org/show_bug.cgi?id=590817 for details.

  • Display the all text entered for all folder at Item and Header level of PO

    Hi everybody,
    I have the task like the following :
    In a PO there are text folders available at Header and Item level. I want POs with type Purchasing document type u2018ZFu2019 ( First Article PO ) should display all the texts entered into any of these folders either at Header level or Item level during print preview and PO output like Purchasing document type u2018NBu2019 ( Standard PO ).
    u2022 The technical information relating above subject ( SAPScript ):
    o The layout set ( form ): ZPCC_PURCHOR_STD
    o Print program : SAPLMEDRUCK
    u2022 The problems like the following :
    o I found out the differences in debugging of 2 types of Purchasing document type u2018ZFu2019 and u2018NBu2019 .
    o Only Purchasing document type u2018NBu2019 the print program processes Text Elements (HEADER_TEXT, ITEM_TEXT, SUPPL_TEXT) to display all the texts entered into any of these folders either at Header level or Item level.
    o To control the displaying of Text Elements as I know I need a print program, however, our print program is standard print program of SAP system in this case. So I can not make any changes there.
    Do we have the configuration place to this one.
    Please help me to fix the problem. Thank you in advance !

    Hi
    I advise to use the subroutine pool as your sapscript is the bespoke one ( Z one) . So you can make use of the below pseudo code.
    In the sapscript the point where you want to display the text include the following code (
    Assume that your are print header text Then first find out the Co-ordinates for it .Go to me23n->Text tab-> In change mode -> double click on text editor-> which takes you to sapscript layout->Under Go to -> Click on header & get the following details.
    Text name : ekko-ebeln
    Language : ekk-spras
    TEXT ID : F01
    TEXT OBJECT : EKKO.
    /: DEFINE &V_ID& = 'F01'
    /: DEFINE &V_OBJECT& = 'EKKO'.
    /: DEFINE &V_LINE1&
    /: DEFINE &V_LINE2&
    /: DEFINE &V_LINE&
    /: PERFORM GET_HEDER TEXT in program Z_PURCHASE_TEXT
    /: USING &EKKO-EBELN&
    /: USING &EKKP-SPRAS&
    /: USING &V_ID&
    /: USING &V_OBJECT&
    /: CHANGING &V_LINE1&
    /: CHANGING &V_LINE2&
    /: CHANGING &V_LINE3&
    /: ENDPERFORM
    &V_LINE1&
    &V_LINE2&
    &V_LINE3&
    Now in the Subroutine pool Z_PURCHASE_TEXT
    FORM GET_HEADER_TEXT USING IT_INPUT STRUCTURE ITCSY
                                              CHANGING IT_OUTPUT STRUCTURE ITCSY.
    LOOP AT IT_INPUT.
    CASE IT_INPUT-NAME.
    WHEN 'EKKO-EBELN'.
    V_TEXTNM = IT_INPUT-VALUE.
    WHEN 'EKKO-SPRAS'.
    V_LANG = IT_INPUT-VALUE.
    WHEN 'V_ID'
    V_ID = IT_INPUT-VALUE.
    WHEN 'V_OBJECT'.
    V_OBJECT = IT_INPUT-VALUE.
    ENDLOOP.
    USE FUNCTION MODULE READ_TEXT BY USING ABOVE PARAMETERS AND READ THE TEXT AND FILL THE VALUE IN FIELDS IT_OUTPUT.AS BELOW.
    BEFORE THAT FILL V_LINE1,2,3 AFTER GETTING A TEXT FROM READ_TEXT FUNCTION MODULE.
    LOOP AT IT_OUTPUT.
    CASE IT_OUTPUT-NAME.
    WHEN 'V_LINE1'.
    IT_OUTPUT-VALUE  = V_LINE1.
    WHEN 'V_LINE2'.
    IT_OUTPUT-VALUE  = V_LINE2.
    WHEN 'V_LINE3'
    IT_OUTPUT-VALUE  = V_LINE2.
    ENDLOOP.
    ENDFORM.
    Declare the valriable in the routine v_textnm,v_lang,.....
    I hope this hint help you to resolve your issue. Note : the spelling of commands which i have wrote may be incorrect.
    Cheers
    Joginder

  • Question about what the content should be for a database standards document

    Hi Experts,
    I am working as development DBA in a J2EE project and have a task to create a database standards document. The document should be used as a reference by the developers when they submit requests for database changes - like adding or making changes to the database schemas (adding tables/modifying them etc.). I thought of what would be the right content for this type of standards document and I think that such a document should have the following as database standards:
    1) Naming standards for the database objects.
    This will include all database objects like tables, columns, primary keys, foreign keys, views, triggers, procedures etc.. For example a standard can be defined like: all primary keys should be named as PK_TABLENAME. All indexes should be named as <TABLE_NAME>_IDX01 etc.
    2) Use of Oracle reserved words should be avoided in the schema object names.
    3) The names should be descriptive so as to make their purpose self evident.
    4) Wherever possible, tables should have primary keys.
    5) Wherever possible columns should be defined NOT NULL -as it helps performance (Indexes on NULLABLE columns are not used by the optimizer).
    6) When submitting request for a new table/tables, typical queries against these new tables should also be worked out and based on that indexes that will be needed for the new tables should be defined. In case this is not clear at the time of initial table creation, it should be clarified within 3 weeks (just a reasonable period to be mentioned here).
    Is this fair enough content forthe standards document or does it miss some important aspects? Note that we do not have to cover in this document standards for database creation or RAC installation etc. It is a document of standards to be followed by developers as a reference when submitting database changes. I will be thankful for your review.
    (Oracle version info: We are on Oracle 11.2.0.2 on Solaris 10.)
    Thanks,
    OraserN

    rp0428 wrote:
    >
    5) Wherever possible columns should be defined NOT NULL -as it helps performance (Indexes on NULLABLE columns are not used by the optimizer).
    >
    That isn't true - post a link that supports that statement.
    Heap indexes do not INDEX null values but indexes on NULLABLE columns are most certainly used by the optimizer for use cases where your query is looking for non-null values.
    Columns should be defined NOT NULL when your business requirement is that the column should ALWAYS have a value. You can, of course, adopt some standard default value (e.g. 'U' for unknown) and make an otherwise NULLABLE column NOT NULL so that each row WILL be indexed. That may only be useful if you want to be able to search for rows that have that value and those rows are in the minority.Then I must be wrong....I will modify the standard as:
    5) Whenever the business requirement is such that the column will allways end up having a value , then all such columns should be defined as NOT NULL. Also if a column can be defined to have a default value then this default value should also be specified.
    Hope this is more proper then earlier and thanks a lot for the review!!
    Edited by: orausern on May 13, 2013 9:53 AM

  • Hi guys, I would like to ask about how to setting pop-up programatically (C#) whereas the pop-up allow us to unblock for spesific website, so far the way I know is doing manually by add Exceptions in the Content tab, Thanks for helps

    by setting programatically hoped each user not need to setting up their browser but just running the program

    Exceptions are stored in the permissions.sqlite database file, so you would need to add the correct entry to that file to add a specific exception. You can add an exception in Firefox to see with an SQLite manger extension or program which SQLite code you need to run to add that specific exception.
    *SQLite Manager: https://addons.mozilla.org/firefox/addon/sqlite-manager/

  • Terminal: how do I list the contents of directories for specific files?

    I want list all quicktime movies under a specific directory (and then output this into a file)
    When I do this: ls -Rl
    This list everything under the folder and subdirectories - the 'l' flag I used to get just file names
    When I do this: ls -Rl *.MOV
    Nothing is found
    I've tried: ls -Rl *MOV
    I'm sure I'm missing something fundamental
    Thanks
    Omar

    Use a command such as:
    ls ~/Desktop/Archive/*.mov
    Case matters when doing this; using MOV and mov will produce different results. This doesn't work if done with the R flag.
    (87610)

  • I have a password to open the content code file for the OS X Mt Lion Up-to-date program.  Does anyone know how I go about using this password to upgrade Mt Lion?

    I have a password issued by Apple to upgrade OS X Mt Lion.  I need help finding where I enter this password to get the upgrade.  Thanks

    The password should be used to open the PDF file that was also sent.
    Inside the PDF is a redemption code.
    Go to the Mac App Store and click on the Redeem link in the Quick Links section:

Maybe you are looking for

  • How do i delet 8 and go back to my older version?

    you took a way everything that i like and understood. where my cookies? where is the tools? I don't want to learn all over. Just want to delete the the new and go back to what i know

  • ITunes Music Card credit disappeared

    I had $10 left of credit on an iTunes music card and I went to purchase a song when an icon popped up and said I could no longer redeem point on my music card and the credit in the upper right hand corner of iTunes suddenly disappeared. It's been abo

  • Repeating system alert sound, without user action 10.6.1

    After installing 10.6.1 on my Macbook Pro unibody 17", i get a repeating system alert sound every 2 seconds. I have restarted,logged out,changed my sound settings, and eventually just had to turn the system alert volume all the way down. Anyone else

  • Iweb won't work on Safari but WILL work on Firefox!

    This is a good one. I just updated my iweb page. It said it was uploaded successful and do I want to visit, announce or 'ok' (you know). Anyway, I said "visit now" and the updates showed up fine. BUT when I typed in my website directly into a URL usi

  • Invoice Date based on GI and POD

    Hi All, I am facing a situation when packed and bulk products can be delivered to the same customers. However, for deliveries with packed products an Invoice Date should be based on Goods Issue, but for the bulk products to the same customer i'ts sho