String unicode -- understanding what is happening

Hi,
Can some one please explain how the following is working in string
Case1:
1) Assume I have set of bytes encoded in UTF-8.
2)Iam reading the UTF-8 bytes using inputstreamreader and store it in string
3) I know string stores it in unicode -- But what encoding? (UCS-2 or UTF-8 etc)
Case 3:
4) Suppose SJIS bytes are encoded using UTF-8 and Iam reading using UTF-8 and storing it in String and then printing it using System.out.println()(locale is set to SJIS), who does the converstion from Unicode representation of the string to SJIS
Case 2:
* Bytes are SJIS encoded
* Read it using UTF-8 ( wrong encoding used to read)
* Store it in string . How will it store?
* Print it using System.out.println in a machine whose locale is set to SJIS.
* Who is doing the conversin from unicode to SJIS

Guessing...
Case1:
1) Assume I have set of bytes encoded in UTF-8.
2)Iam reading the UTF-8 bytes using
inputstreamreader and store it in string
3) I know string stores it in unicode -- But what
encoding? (UCS-2 or UTF-8 etc)
Depends on how you 'store' it. If you use String explicitly then the default encoding of the system is used. If you use String explicitly with an encoding then that encoding is used.
Most, but not all (bugs), implicit conversions for readers use the default encoding.
Case 3:
4) Suppose SJIS bytes are encoded using UTF-8 and Iam
reading using UTF-8 and storing it in String and then
printing it using System.out.println()(locale is set
to SJIS), who does the converstion from Unicode
representation of the string to SJIS
What conversion? If it is a String then it is UTF-8. If you 'display' it then it uses the OS encoding.
Case 2:
* Bytes are SJIS encoded
* Read it using UTF-8 ( wrong encoding used to
o read)
* Store it in string . How will it store?Garbage for the most part.
* Print it using System.out.println in a machine
e whose locale is set to SJIS.
* Who is doing the conversin from unicode to SJIS
Garbage in, Garbage out.
By the way there is a Internationalization forum and presumably you could get answers there.

Similar Messages

  • I don't understand what's happening with my Music. All the songs that I purchased, that were previously on my phone, now show up a Cloud next to them, but I can't play them. If I touch the Cloud, it turns into a red square but never downloads.

    I don't understand what's happening with my Music. All the songs that I purchased, that were previously on my phone, now show up with a Cloud next to them, but I can't play them. If I touch the Cloud, it turns into a red square, acts like it's downloading (which I can see happening in iTunes), but never downloads. The Cloud just stays there.
    I've sync'd my phone, I've turned it to "show all music" in Settings, I've drag and dropped the songs/albums onto my phone again. I feel like I've tried everything I've seen recommended, but nothing works.
    I've purchased a lot of music from iTunes. It should be there. What's going on?
    P.S. Same thing happening with my purchased books. Ugh.

    Once you successfully add you iTunes library to iTunes Match, you go to Settings>iTunes & App Store on your iOS device and turn on iTunes Match.  Your iTunes Match library will then appear on your iOS device.

  • I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition and the DiskU

    I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition and the DiskUtility. The Apple Logo and the Progress Indicator will continue to spin and I have literally no idea what to do. i am in desperate need of help. help me pls

    Turn it off.
    Start it up again and (at the sound of the chime) press and hold the command and the R keys, hold them down until Recovery loads. When it does you will select Disk Utility and you should be on the First Aid tab when it opens, if you are not please select it. Then select the partition (in the side bar, 2nd entry on the list, see picture).
    Yours is probably called Macintosh HD.
    Once you have selected it go to the lower righthand corner of the First Aid dialog and press Repair Disk.
    This will take 10 minutes approximately. Post back when it is finished and tell me what it says.

  • I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition

    I've tried safe mode but I dont understand what is happening. I tried pressing the power button on and off for several times and nothing happens, I'm always stuck on an apple logo and a spinning wheel. I dont know how to get to the Partition and the DiskUtility. The Apple Logo and the Progress Indicator will continue to spin and I have literally no idea what to do. i am in desperate need of help. help me pls

    Reboot hold the command R for recovery.

  • I don't understand what's happening.

    My friend has given me a dvd with a tv episode on it every week for past 8 weeks.  This week the file appears on my pc at work as an MP4 file episode 8. When I open it on my mac it appears as episode 6 and it's an AVI file. My friend downloaded it last night (24th May) but it comes up as created 2 weeks earlier which is correct for episode 6.  This has happened twice with 2 different dvds.  How can this happen?

    How do I find the right one? That's the only one that appears when I load it. Sorry to be such an ignoramus

  • Trying to understand what's going on with my line!

    I wonder if someone could help me understand what's happening to my connection.
    I've been on adsl2+ for over a month (since being on a very stable adslmax connection). I'm on a long line 62db atten' and connected at 2890 - same as adslmax which I expected.
    A week ago my connection was reset ( I was unaware) and now connect at 2271 - noise margin is now 13db - always had a stable 6db with no drops.
    The thing I don't get is every time I reboot my router constantly syncs at 2271. Why would it do this? Previously it sync'd at different speeds.
    It's as if I'm now on a fixed rate - but still shows as adsl2+.
    Spoke to bt but they say I have noise on my line and it's in 'acceptable levels' - which it isn't!
    Just want to understand what's going on!
    Thanks

    since the recent software/hardware updates at certain telephone exchanges, when you reboot the router or turn it off constantly, the exchange you are connected to sees it as a fault, and drops your connection to the lowest level possible. your connection then has to physically be  reset by an engineer at the exchange.
    this is what hapenned top me. for the last 8 years i have been on bt, always turning my router off at night, when i had finished, or rebooting it if i had a poor line. since june, my connection speed have been abismal, i stopped at 2420 for about a month (half of that the month before) then over a weel, it dropped to as low as 340kbps - on a 20 meg line.  after going through the help desk, and "you need a new bt homehub router" event though i did not use theirs, phase, and 2 months of stress, i had an engineer come out on Saturday.
    He tested everything (my line is capable of 18.3mb connections). my line was reset ay 8124kbps downstream... 27 hours later, it is on 572kbps, so needs to settle in..allegedly
    to get over this, i am using a BTfon zone connection off one of my neighbours, as it is faster...technology - if you are on option 3, then sign up for it now, as things may get worse.
    welcome to the world of last wednesday week.
    there's now't wrong with 2 cans and a piece of string. at certain times, it is often faster.

  • Could you help me in understanding what this code means ?

    Hi, I was reading an article about Comparing Objects. Well, here's the link:
    http://www.onjava.com/lpt/a/3286
    The link I found it somewhere in this forum too...it's about sorting an array based on another sorted array...I can't understand what is happening inside this code...Well, I knew it is a method, because it actually a member of a class Person. The problem is that, everytime I delete this part of method in a class which implements Comparable...it always throws an error...is it possible if I don't use this method below ?
    public int compareTo(Object anotherPerson) throws ClassCastException {
        if (!(anotherPerson instanceof Person))
          throw new ClassCastException("A Person object expected.");
        int anotherPersonAge = ((Person) anotherPerson).getAge(); 
        return this.age - anotherPersonAge;   
      }Thank you very much !
    Sincerely,
    Chris

    Thank you, I am new in Java Programming, and my class will start talk about Sorting Array next week, and I know that I am so weak in Sorting things...so, I have to encourage myself, so that I could understand what they will discuss in the class....
    //WHAT IS THE "!" sign before the anotherPerson instanceof Person means ?
    if (!(anotherPerson instanceof Person))
          throw new ClassCastException("A Person object expected.");
    * I know that Person is the class name and anotherPerson is an object of
    * class Person but: ((Person)anotherPerson)...what is that mean ?
    * so the getAge() method refers to anotherPerson's age ?
    * or the Person's age ?
    * Say that I don't want to sort it based on the age, but I want to sort it,
    * for example:
    * by its character's length, do I have to create a method to get the
    * characters length ?
        int anotherPersonAge = ((Person) anotherPerson).getAge(); 
        return this.age - anotherPersonAge;
       }Thank you...
    Chris

  • I don't understand what is going on

    I sold my curve2 and got a new torch1, i don't understand what is happening. I see the contacts of the person using the curve2 now, and he changes my dp and display name. I tried creating a new BBID but its still the same.
    Solved!
    Go to Solution.

    graceycutey wrote:
    No I didn't
    We should always perform a security wipe before transfering ownership . I assume the other person is using BBM 7 or higher in which everything is controlled by our BlackBerry ID and the current issue is only possible if  he is having the same BlackBerry ID as your's, Do you know that person ? 
    You can change your BlackBerry ID but you should first try to reset the password for your BlackBerry ID , Refer to this Knowledge Base to reset your BlackBerry ID password. 
    KB26361  :How to change or reset a BlackBerry ID password.
    Or change or Update the BlackBerryID from BlackBerry ID website :
    KB28060 : How to change or update a BlackBerry ID username on the BlackBerry ID website
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • I have a Power Mac G5 Dual 2.3 running 10.5.8, I understand that I can not upgrade to Lion, so what will happen to my Mobile me, which I can not live with out?

    I have a Power Mac G5 Dual 2.3 running 10.5.8, I understand that I can not upgrade to Lion, so what will happen to my Mobile me, which I can not live with out? Also will I be able to get Icloud to work?

    Hi Mary, the other so called "Features" of iClound will not work for like Syncing, but eMail will.
    MobileMe & dot Mac will still work last I heard.
    iCloud Mail setup, even in 10.4/10.5…
    Don't delete your old account yet. Just setup a new one in Mail>Preferences>Accounts, little plus icon. Choose IMAP as account type, not ,mac or MobileMe.
    IMAP (Incoming Mail Server) information:
              ▪          Server name: imap.mail.me.com
              ▪          SSL Required: Yes
              ▪          Port: 993
              ▪          Username: [email protected] (use your @me.com address from your iCloud account)
              ▪          Password: Your iCloud password
    SMTP (outgoing mail server) information:
              ▪          Server name: smtp.mail.me.com
              ▪          SSL Required: Yes
              ▪          Port: 587
              ▪          SMTP Authentication Required: Yes
              ▪          Username: [email protected] (use your @me.com address from your iCloud account)
              ▪          Password: Your iCloud password

  • I have not made any purchages 14th and 15th Apr 2012. But Apple Itunes Store had collected money from my Credid Card. How do I get the support to understand what happened.

    I have not made any purchages 14th and 15th Apr 2012. But Apple Itunes Store had collected money from my Credid Card. How do I get the support to understand what happened.

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
     Cheers, Tom

  • Location of profile -- need to understand what happened here

    I just resolved a data recovery crisis with my bookmarks. Although the crisis is over, I don't understand an important aspect of what happened, and I need to resolve this to be entirely confident of my data's safety.
    Last week my computer contracted a virus. My attempts to remove it have been unsuccessful so far, so I fell back to an alternate version of Windows XP that I keep on my computer for that purpose. I have a separate data disk and configure all of my applications to store their data there, so this should be a nearly complete workaround -- all I lack is new software that I've installed since I created the backup partition.
    As I checked out the system after booting, I looked at my Firefox bookmark file and was flabbergasted to find that its time stamp was over three years old.
    I did some research and discovered that when Firefox went to version 3 it replaced the bookmark file with a database stored in a "profile" in the Application Data directory. I wasn't aware of that, so I never reconfigured Firefox to move the profile to my data disk.
    This looked very, very bad. It looked like I'd said goodbye to all the bookmarks I've collected since I created the backup system until I got my infected system working again.
    To make the best of it, I deleted the useless bookmark file and moved the Firefox profile from my system disk to my data disk, where it should have been all along.
    Then I started Firefox (this system is running version 4) and found that all of my bookmarks were there, right up to the one that I added yesterday with instructions for removing the particular virus I'm dealing with.
    How did it do that?
    I first thought there must be another profile on the data disk, but I searched the whole disk for one of the file names in the profile, and found only the one I had just created. Later I realized that even if there were another profile, that wouldn't explain what had happened. Firefox is now using the one that I just created -- I checked the timestamps to confirm that they were being updated -- and I copied it from a system drive in a partition that hasn't been used for months. I'm delighted to have all of my bookmarks, but they seem to arrived where I need them by magic. What could have happened here?

    auscompgeek, I appreciate your effort to help. Either your response doesn't address the question, or I don't understand it.
    Here's how it looks to me: places.sqlite is part of the profile, i.e., it is one of the files in the directory that contains the profile. I've explained what happened to that directory. The fact that the bookmarks are stored in this particular file is true, but doesn't explain anything.
    I searched my data disk for this file on the chance that there was a stray copy of it somewhere, not in a complete profile directory that contained the file I originally searched for. I found it only in the new profile that I created after discovering the problem.
    So this issue still appears to be unresolved.

  • Hello congratulations for the work you have been developing. The iCREATE has helped me greatly improve my Mac and better understand some applications. Recently my iPhoto has given me problems and I do not realize what is happening. When I double click a p

    Hello congratulations for the work you have been developing. The apple support has helped me greatly improve my Mac and better understand some applications. Recently my iPhoto has given me problems and I do not realize what is happening. When I double click a photo it does not appear ... or rather the background is black and only the zoom window appears. How to solve this? I've done a restoration of the library, but the problem remains. Thanks and good job.

    There are several possible causes for the Black Screen issue
    1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
    2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help:
    As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • HT204406 itunes crashes my computer (windows 7) while trying to upload my music. Its happened multiple times now and I have no songs which are more than 200 mb. Dont understand what is breaking it

    My itunes keeps crashing while trying to upload music ti icloud using match. I have checked my collection and there are no songs more than 200 mb. The problem is getting so bad that now my OS (windows 7) is crashing. Dont understand what is breaking itunes....

    My itunes keeps crashing while trying to upload music ti icloud using match. I have checked my collection and there are no songs more than 200 mb. The problem is getting so bad that now my OS (windows 7) is crashing. Dont understand what is breaking itunes....

  • LibMagickCore-Q16.so.7 - Trying to understand what happened

    Hi,
    I'm relatively new to arch and I'm no experienced C compiler, but anyway I want to understand how my linux distro works under the hood and what went wrong, when I simply typed 'pacman -Syu'. Perhaps someone can help me The situation is as follows:
    I was playing aroud with the upcoming release of rails, building an app, that uses the 'rmagick' gem (freakin cool ruby way to say 'package'; in case you don't know). But upgrading my arch as usual, for a few days now my rails server doesn't start anymore, instead saying:
    /home/jan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0.beta1/lib/active_support/dependencies.rb:228:in `require': libMagickCore-Q16.so.7: cannot open shared object file: No such file or directory - /home/jan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick2.so (LoadError)
    But:
    $ ls -l /home/jan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick2.so
    -rwxr-xr-x 1 jan users 528487 Mar 9 04:22 /home/jan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick2.so
    So this file seems to exist at all.
    And a quick search on my file system yields
    $ sudo find / -iname "*libmagickcore*"
    /usr/lib/libMagickCore-6.Q16.so.1.0.0
    /usr/lib/libMagickCore-6.Q16.so.1
    /usr/lib/libMagickCore-6.Q16.so
    So (for me) it seems, that there is a naming problem with this so called .so file (compare to the " libMagickCore-Q16.so.7" part in the error above). I read in another forum concerning a similiar problem to do some magic with 'ldconfig' and I tried this, but this didn't help, too. I also read some stuff about symlinking files. But I don't want to do this since I don't know, what I'm doing with that. I'd rather like to understand what's going wrong here. Can someone help? Or can I provide further information that's helpful?
    Thanks
    Jan

    the error message means that /home/jan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick2.so NEEDS libMagickCore-Q16.so.7 , and that is the file that doesn't exist.
    the libMagickCore-6.* files belong to the imagemagick program.
    A search for libMagickCore-Q16.so.7 shows that imagemagick changed the library naming , starting with version 6.8.0-8
    These links will give more info : 
    http://www.cmake.org/Bug/view.php?id=13859
    http://www.imagemagick.org/discourse-se … =3&t=22352
    you can try building rails against the new version, but if ruby is build through CMake that won't work unless you use  a git version or CMake 2.8.11 is released.
    A temp workaround would be to revert to the last version of imagemagick before the change was made.
    Look at the changes for arch imagemagick to figure out which version that would be.
    (pacman log can also help with this).

  • Because I want to check my location after they said Actions will take effect when this iphone connects to the internet I dont understand what happen

    because I want to check my location after they said Actions will take effect when this iphone connects to the internet I dont understand what happen

    One post is enough, no need to create 3 threads on the same subject.

Maybe you are looking for

  • Sort sequence functionality in Batch management

    Hi All, I have a doubt in batch management. I am not sure whether it is a basic doubt. But obviously confusing me a lot and I am not able to find appropriate for that. In our company, we have two characteristics assigned to the batch class 023. Shelf

  • Problem with XML SQL  JDBC adapter

    Hello All. I have quite strange problem with my PI. Whole scenario is SOAP -> JDBC, asynchronous. Everything works fine on DEV server. After transporting objects (using CTS) to QA env I'm getting this error: JDBC Message processing failed, due to Err

  • Can't read attached .eml files after update to 10.2.0.429

    Hello all we have 2 z10 in office. I did the upgrade first, and since them MOST (not all) af the regular mail with attached .eml files we receive from a governmental source cannot open (to be clear, those are regular mails containing another mail as

  • Problem with bookstore1 example in J2EE 5 tutorial

    Hi everyone. I'm pretty experienced with J2EE but new to the 1.5 version. I'm using the Sun One Server 9.1 and the ant tools. This is referring to the samples in the J2EE 1.5 tutorial. I set my build.properties file and tried to build bookstore1 usin

  • ITunes/IE Error Message. Please Help Me!

    I downloaded the newest iTunes after restoring my computer from October 18th, trying to get the old iTunes back, as the newest deleted all my music. Anyway, I downloaded it, and now every time I try to open it, I get that Internet Explorer error mess