Can I change Encoding used in InputStreamReader

Hi Java Gurus:
Wanted to know if I can somehow change the encoding used by InputStreamReader, the value of which I get by InputStreamReader.getEncoding().
I did change file.encoding to UTF8, but that does not change the encoding used by InputStreamReader.
I am getting garbage data when reading a chinese character from a Swing GUI. If I convert the string into a byte array using utf8 encoding, the bytes look OK, but when I print the string, it is all garbage and gets stored in the database (thru JDBC) as garbage (?)
Any pointer(s) would be a great help guys!
Thanks,
Micky G

Hi Mickey,
Wanted to know if I can somehow change the encoding used by InputStreamReader,
the value of which I get by InputStreamReader.getEncoding().Easiest way is to specify the Charset or Charset name String in the constructor,e.g.:
InputStreamReader isr = new InputStreamReader(iStream,  "UTF-16")
I am getting garbage data....I don't quite follow what you're describing in this paragraph. Can you elaborate?
Regards,
Joe

Similar Messages

  • I have iMac osx  version 10.8.5 and i forgot my account login password. i can't change it using my apple ID nor i remember my password.also my fire vault is not on and my keychain won't help. PS i can't also use the terminal idea it always not found.help

    have iMac osx  version 10.8.5 and i forgot my account login password. i can't change it using my apple ID nor i remember my password.also my fire vault is not on and my keychain won't help. PS i can't also use the terminal idea it always not found please help !!

    You need to restart the iMac and hold down the Command and R keys immediately.
    You will then have the utilities drop down and you choose Terminal
    When Terminal opens, type exactly:
    resetpassword
    and press Return.
    When the Reset Password window opens, select the user for which you want to change the password.
    Enter the new password twice, and then click Save.
    Accept the next dialog window,
    And then Apply
    When finished click the apple at the left side of the menu bar, and the Restart.

  • How can I change passwd using CLI

    How can I change userpassword using iPlanet Delegated Administrator v1.1 Command Line Utilities?
    (imadmin user modify ... -A userpassword:MyNewPasswd

    In SIMS 4.0
    1) You know uncrypted password / setup a new one:
    imadmin modify user ... -W user_passwd
    2) You know crypted string:
    imadmin modify user ... -A userpassword:{crypt}a1vDyDPBLgTU2
    For both, you need administrative privileges.
    R.

  • How can I change encoding?

    Hello...
    I am korean.. so My English ability very poor. sorry...
    I want to change encoding...
    When I maked xml file by transformer
    default sentence maked......like that.....
    <?xml version="1.0" encoding="UTF-8"?>
    but I want to change encoding='euc-kr';
    <?xml version='1.0' encoding='euc-kr'?>
    so. I did like that...
    File f = new File("d:/xml.xml");
    FileWriter saveFile = new FileWriter(f);
    SaveFile.write("<?xml version='1.0' encoding='euc-kr'?> \n");
    StreamResult sr = new StreamResult(saveFile);
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.transform(doms, sr);
    but When I did....
    two sentence maked....
    <?xml version='1.0' encoding='euc-kr'?>
    <?xml version="1.0" encoding="UTF-8"?>
    like this....
    how can I solve my problem....
    thank you

    hi there! please never ever try to do this manual insertion prior to transforming...
    use this:
    t.setOutputProperty(OutputKeys.ENCODING, "euc-kr");

  • How can I change the use for iCal

    I currently use iCal so that my iPad, iPhone and iMac are all synch'g.  So far it has worked seemlessly until now at least!
    My iTunes account is setup under my wife's name so iCal is actually listed through her.  This has never been a problem but I just realized that when I accept and invitation to a event on my calender it lists it as my wife's name not mine.   Can I change that without affecting all of my calenders?

    So far I have been able to change the name that was listed under iCloud under ical's user settings.  It didn't change the name that was listed on my event that i already responded to.  ANyone know if this would make the difference?

  • Can I change encoding options?

    I know in preferences I can choose between best quality and best performance, but neither of these are any good....any video I've encoded looks crappy on dvd...I've used several different players and multiple tv's. If the tv is over 46 inches everything looks crappy...if it's smaller, it looks 'ok' at best. When I encoded using Toast, things looked a lot better, but I had more control over the encoding settings. I prefer the more polished look of iDVD and love their templates. If there is a way to exercise more control over the encoding I"d love to know...
    Thanks in advance!

    John T,
    I've encoded with both Toast and iDVD, and I think iDVD is just as good, even on my 42" plasma....but with one HUGE caveat: If you are using still pictures in iMovie before going to iDVD, the encoding will be horrible if you do not use the Ken Burns efffect on all your stills.
    Also, sometimes what looks like horrible encoding is actually sub-standard burning. I always "Save as Disk Image" and burn at 1X using Toast.
    But the final answer to your 64$ questions is that Best Quality and Best Performance are the only two encoding options that exist in iDVD.
    John B

  • Can I change Encoding method in RoboHelp10?

    Hi guys,
    I am working with a Japanese project in RoboHelp 10. But when I opened this project in English OS everything will be messy code, in Chrome or IE I can change Encoding to fix this issue. Anything I can do this in RoboHelp 10?
    Messy code:
    Thank you!
    Nick

    Are you expecting to open a project created in Japanese to then be opened on an English OS and have the source translated?
    I really don't think it works that way.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How can I change from useing an english keyboard to a French one

    how can I change from english to french

    Take your stylus and tap and hold on the analog clock and you will get a drop down list with two choices analog or digital. Choose digital.
    Post relates to: Centro (Sprint)

  • How can I change language used by Apple to send account reset to me?

    HHow can I change language on password reset post by apple

    The Google translation app should be able to handle it. I'm going to ask the hosts to move your post to the iPad Forum in case other people have ideas.
    https://itunes.apple.com/us/app/google-translate/id414706506?mt=8

  • What determines my identity when I visit a web site? How can I change or use multiple identities?

    Often, when I visit an internet site, the site identifies me automatically, without my having specifically provided an identity. The identity seems to partially correspond with one of my email addresses. How can I use multiple identities and change identities?

    Make sure that you have installed support for complex script languages.
    * http://en.wikipedia.org/wiki/Help:Multilingual_support_%28Indic%29 Wiki: Help:Multilingual support (Indic)
    * http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/int_pr_install_complex_languages.mspx
    Make sure that you allow pages to choose their own fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced: [X] "Allow pages to choose their own fonts, instead of my selections above"
    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Is this only happening with the English text or also with the Bengali text?

  • REG : Can we change namespace using any adapter module.

    Hi All,
               I was working on the XMLAnonymizerBean adapter module. his module provides us the functinality of changing the prefix of namespace and selecting  sprecified modules in the output XML. Now i am stuck with a question ie is there any module that can change the namespace in the output xml. for example :
    xmnls :  namespace1 to
    xmnls : namespace 2.

    Hi,
    You can use a simple XSLT mapping in Receiver adapter . check this blog
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417100%29ID0975923150DB01234155231841994144End?blog=/pub/wlg/2620
    Provide the actual namespace in the bleow code
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:p2="provideyournamespace">
         <xsl:template match="/">     
                       <xsl:copy-of select="*"/>
         </xsl:template>
    </xsl:stylesheet>
    Regards
    Suraj

  • How can i change font used by the java plugin?

    im running j2se 1.4.0 on win2k, and the java plugin is using a font that is not readable because sized way too small (also, the font is not a 'standard' font).
    the font is also applied do class loading or exception messages in java applets (in IE5.5, but i don't think that this is browser-related).
    is there a possibility to change to font (or the font size)?

    thanks for the tip, but this problem seems not to be tightened to the font.properties file:
    the wrong font is only used with the j2sdk1.4.0 plugin, not with that from j2re1.4.0 (actually, i had installed jre first, and afterwards j2sdk without removing j2re before). changing the plugin used back to j2re made the java console display the correct font (though the font.properties files were identically in both cases).

  • My wife and I use one Apple i.d. account.  How can I change to use two i.d.'s and retain all my contacts and music and allow my wife to likewise save her contacts and music, too?

    My wife and I each have Iphone 4s and I also have Ipad latest version with 6.0 operating system.  Additonally we have Ipod Classics (a few years old) and when I got the 4s and Ipad (at different times) they started to share contacts, apps...everything with each other.  I bumped up the amount of Icloud space, but more importantly, how can I create two separate accounts yet save all the contacts, music, etc. that are in both of our phones?  Can Verizon (our cell provider) archive our contacts for downloads at different time to our separate accounts?  Thanks.

    Just call yur provider and they will set it up with you.
    This is what I do, when I get a new iphone and give mine to my wife.

  • How can I change from using Adobe in fire fox to using only adobe app. I have checked in tools to use adobe reader but adobe in fire fox keeps coming up.

    I know I was able to do this before. Under tools - options - applications - PDF files are listed to use Adobe reader but everytime I open a PDF it comes up using adobe in Firefox. I do not that. Want to be able to open the PDF right there.

    My instruction should be:
    Tools / Add-ons / Plug-in
    and you should see Foxit Reader Plugin there. Click on the line and you'll see a "disable" option there.

  • File Creation Automation - Can I change encoding specs?

    Hello!
    So, I setup a watch folder...
    1. FCServer looks at the folder and when a new file appears it encodes an M2V file.
    2. It then deletes the original file.
    3. It sends me an email alert.
    The problem I'm having is...I don't see anywhere to increase the quality of the video file. I just need to bump it up a little and don't see anywhere to do this. I've looked both in the System Preferences pane for FCServer and in the client.
    Any ideas?

    Nevermind...found it!

Maybe you are looking for