UTF-8, Unicode, XML and windows problems

Hi there,
I'm developing an application which uses a lot of russian text.
This russian text is stored in XML and can be sent to a server remotly
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string.
So when I generate xml and print it out I get something that looks like the following:
��������� ������������ ���������?����Thats ok, beacause I can stick that streight into a file when writing files and it works.
But the problem comes when sending the XML over the server.
The sending implentation I use must be able to send java generated utf-16 and xml read utf-8.
So I convert the XML from utf-8 to utf-16, using the following:
byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
utf8String = new String(stringBytesISO, "UTF-8");And that works perfectly on my linux system.
However when I run it on windows, it only seems to convert some of the characters
Привычным �?ном за�?нут дороги до ве�?ны,Does anyone know whats going wrong here?

jammers1987 wrote:
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.DbUnit is a testing tool; are you saying you're using it in a production system? Ideally, you should use the same library to write the XML as you do to read it, but you definitely shouldn't be using DbUnit in this context.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string. That should never happen. XML is just text, and text can either be in the form of a Java string, or it can be stored externally using a text encoding like UTF-8. Never mind that Java strings use the UTF-16 encoding; you don't need to know or mention that. Encodings only come into play when you're communicating with something outside your program, like a file system or a database.
When you generate the XML, you specify that the encoding is UTF-8. When you read the XML, you specify that the encoding is UTF-8. That's all.

Similar Messages

  • Dual Boot Linux and Windows problem with HDDRecovery

    Hello
    I`m using dual OS Windows Vista and Linux open SUSE distribution on Toshiba Satellite A350-10z, everything is working great except Windows Recovery. I have Linux (boot:dev/sda6) and Windows Vista (boot:dev/sda2). Windows has 2 partitions, Disk C and D, on Disc D i have HDDRecovery folder. After F8 i using the repair option and waiting, then the massage is displayed "The installed program cannot start. Click OK to turn off the computer".
    Before i installed Linux the Recovery worked fine. Is there a chance of using the HDDRecovery from Windows Disk D or i have to boot from Recovery DVD?

    In my opinion Linux has muddled up the partitions or MBR and possibly this is the reason why the HDD recover does not work seems the Recover DVD is your option ion order to set the notebook back to factory settings.
    By the way: I didnt install the Linux on my notebook but I use Linux using the Knoppix Live CD

  • IPod Photo 60G and Windows problems

    I am unable to connect my Photo 60G iPod to my current computer.
    I can connect it successfully to my laptop, so I know that the fault is not with the iPod or the iPod cord. I can connect my daughter's rather elderly 10G iPod to this current machine successfully, so I know it isn't this computer or the iTunes software.
    What I can not do is connect the 60G iPod. When I do, the iPod gets the 'Do Not Disconnect' icon going but then computer usually freezes before opening iTunes and I can only sort it out by shutting off the machine. If I open iTunes first and then connect it, the iPod does not show up and sometimes the 'Do Not Connect' icon comes on and sometimes it doesn't.
    If I leave iTunes closed, attach the iPod and then try to access it via the iPod updater in the Programs menu, it either freezes the machine as above or it gives an error message saying I need to restore my iPod (which I clearly don't, as not only is it working perfectly, it also connects fine to the laptop.) In all these instances, if I try to eject it from the USB port by clicking on the icon in the tray to bring up the 'eject safely' box, it will bring up the initial box and then freeze before bringing up the second confirmation box. In all these freezes, it ties up the machine so badly I have to turn it off at source. It will not even allow me to close down using Task Manager.
    The iPod does generally show up in Windows, if I get that far and it doesn't freeze the machine before. Often it will then freeze the machine if I try to look at it in Device Manager or Windows Explorer.
    I have done the following things to resolve the problem:
    1) Completely removed iTunes and the iPod Updater (numerous times), cleared out all their crap from the seven zillion places it goes on the machine, and re-installed cleanly using only the most up-to-date downloaded versions of both (plus, of course, have also tried the old versions, just in case.) In all instances, my daughter's small iPod works and mine doesn't.
    2) Tried the iPod on every single one of the USB ports on the machine, just in case one wasn't working. (They all are.)
    3) Followed the instructions on these two pages on this site to resolve the problem:
    http://docs.info.apple.com/article.html?artnum=93716
    http://docs.info.apple.com/article.html?artnum=61711
    4) I searched Google Groups, where I found a reference to one problem I was having with the iPod updater which said it could be traced to an issue stemming ultimately from Apple's lack of understanding of the Windows platform and that the software couldn't cope with multiple drives or things not being on the C: drive. I do have my hard disk partitioned and formatted as drives C and D with everything defaulting to D. I would have expected Apple to have fixed this problem by now, as the was in March, so I made sure I have only the latest software, but this hasn't made any difference. I also tried specifically installing it to the C section of my drive but this didn't make any difference either. I suspect this may be a red herring, as if it were a genuine issue, I wouldn't expect my daughter's iPod to work either.
    I don't want to be confined to only downloading music to my laptop, which is very old and slow and has a small hard disk. The problem seems to be very specific to the iPod 60G and I'm trying to figure out how it is different from the smaller iPod my daughter has and how to resolve it.
    Any suggestions?

    The battery will not charge eithger. I have left it in a computer and ab outlet charger both for 1 hour, but no juice is going to the iPod. Is the cord dead? Or is the battery messed up? What is going on?

  • Sample XML and Schema Problem After Regenerate

    We use a PeopleSoft query as our data source for our XML Publisher reports. We added a field to a PS query then regenerated the XML (Reporting Tools-XML Publisher-Data Source). The regenerated XML now has the PS query record letter prefixed to each field name. For example, previously the XML looked like this:
    <FIELD1>FIELD1</FIELD1>
    After adding the new field and regenerating the XML, it now looks like this:
    <A.FIELD1>A.FIELD1</A.FIELD1>
    As a test we removed the new field from the query and regenerated the XML. Now the XML reads like this:<FIELD1>FIELD1</FIELD1>. There is only one table in the query. Why would one new field change the XML to this?
    <A.FIELD1>A.FIELD1</A.FIELD1>
    Thank you.

    XML Publisher running on PeopleSoft CRM 9.00.000
    PeopleTools 8.49.18
    SQL is below. After several tests I've narrowed down the problem to two fields, EMPLID and NEW_EMPLID. When both of these fields are in the PeopleSoft Query the XML is generated like A.FIELD. When one or both of these fields is removed from the query the XML is generated like FIELD (the A. is not prefixed to the front of the field name). Is this because the field names are similar?
    SELECT A.DESCR1, A.DESCR2, A.EMPLID, A.NEW_EMPLID, TO_CHAR(A.ROW_ADDED_DT,'YYYY-MM-DD'), A.PHONE, A.DESCR80, A.NEW_NUMBER, A.DESCR, A.CONTRACT_ID, A.BO_NAME, A.BO_NAME_1, A.DEPTID, A.ADDRESS1, A.CITY, A.STATE
    FROM PS_TEMP1_TBL, PS_TEMP2_TBL B
    WHERE B.OPRID = :1
    AND B.RUN_CNTL_ID = :2
    AND ( B.NEW_FLAG = 'Y'
    OR ( B.NEW_FLAG = 'N'
    AND A.NEW_NUMBER = (SELECT C.NEW_NUMBER
    FROM PS_TEMP2_DET C
    WHERE C.OPRID = :1
    AND C.RUN_CNTL_ID = :2)))
    ORDER BY 11, 13, 5, 8

  • PC suite and Windows problem

    o my god !
    I am running windows xp media center edition 2005 (sp2).Phone-N70 with cable.
    I was already having so much problems with PC suite 6.83....And then I found a FAQ ...it says my pc's operating system is not supported by Pc suite. Wat should i do...Wat is the correct version for me...
    my problem is after installing pc suite-On the device manager...Under portable devices...n70 is disabled...And thr is an error with Windows Portable devices !
    CoOL

    Ya..but everytime i restart my pc....it comes over n over again
    CoOL

  • Satalite a110-195 CD and windows problem

    hello all
    i have my satalite A110-195 and suddnlly windows dammege and cd wont instale another windows it read to middle and stop reading from cd
    i chang the DVD hardware but after chang it the computer wont recognize it and wont read from it
    and i cant instale windows
    i will try to load the windows directly to hard disk from external SATA cable but if any one have idea to lit the machine recognize the DVD hardware
    and thanx for all

    > I searched on the internet and a lot of people had this sort of issue with different Satellite versions but did not find any solution for it.
    Do you really think there is some magic solution for this? It is definitely some serious hardware problem that must be investigated in service with diagnostic tools.
    All you do at the moment is right and you can eventually find out what the problem can be but question is: how to fix this? Can you repair manboard? Can you exchange mainboard? What you can do about it?
    In my opinion all you can do is to find some cheap already used mainboard, exchange it and hope everything will be OK again. This can be a kind of challenge for you and hope you can fix it. Other way, sell it on eBay and obtain newer piece of hardware.
    Sorry but I just try to be a bit realistic.

  • Older GX-730 Laptop and windows problem.

    Hi.  I have an older GX-730 series laptop, and I am having some issues with it that I need some info/advice on.  First, the laptop came with it's OS installed on a ttiny C: partition and the rest of it's tiny hard drive is where the apps need to go.  Only I have a few apps that had to go on C:.  As a result, the C: partition is full.  I was going to just shrink the D: partition and expand the C: partition, but Windows won't let me do it.  Does anyone have a way around this.  Next, does anyone know if it's possible to get a restore disk for the laptop so I can just zap everything and start over?  Two more questions.  Does anyone know what specific RAM I would need to buy to get this thing up to a usable 4GB?  And is there a specific limit on how big a hard drive this thing can handle?  Thanks.

    There are utilities online that you can search for that should allow the expanding and compression of partitions. I don't have one offhand, but do a google search and I'm sure you can find one.
    There should be a program called MSI Burn Recovery on the laptop, assuming that it still has the original Windows installation. That should allow you to make recovery discs.
    I don't know the exact RAM specifics, but if memory serves right, DDR2 800 should be what you need, and I'm not sure if it has 2 sockets or just 1 socket, but it only supports a maximum of 4GB. I'm guessing it probably has 2 sockets, but best to check before you buy anything.
    There probably isn't a limit on the hard drive size, at least not for as long as you will be using it. You could probably put a 1TB hard drive in there just fine to be perfectly honest.

  • Message Mapping Problem with UTF-16LE Encoded XML

    Hello,
    we have the following scenario:
    IDoc > BPM > HTTP Sync Call > BPM > IDoc
    Resonse message of the HTTP call is a XML file with UTF-16LE processing instruction. This response should then be mapped to a SYSTAT IDoc. However the message mapping fails "...XML Parser: No data allowed here ...".
    So obviously the XML is not considered as well-formed.
    When taking a look at SXMB_MONI the following message appears: "Switch from current encoding to specific encoding not supported.....".
    Strange thing however is if I save the response file as XML and use the same XML file in the test tab message mapping is executed successfully.
    I also tried to use a Java Mapping to switch encodings before executing message mapping, but the error remains.
    Could the problem be, that the codepage UTF-16LE is not installed on the PI system ? Any idea on that ?
    Thank you!
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM

    Hi,
    thank your for your answer.
    This is what I have tried to achieve. I apply the java conversion mapping when receiving the response message - i tried to convert the response to UTF-16, UTF-8 but none of them has helped to solve the problem.
    I guess that using adapter modules is not an option either as it would modify the request message, but not the response, right?

  • I've upgraded my firefox into 6.0 version.. when i want to play cityville from facebook it missing the en-US.xml and gameSettings.xml.. how can i fix this problem..??

    when i started my cityville from facebook the loading progress stopped at 73%.. when it stop i need to download file en-US.xml and gameSettings.xml
    this is the download URL for gameSettings.xml : http://cityvillefb.static.zgncdn.com/54988/gameSettings.xml.z
    and this is the download URL for en-US.xml :
    http://cityvillefb.static.zgncdn.com/54988/en_US.xml.z
    when i used version 5.0.1 i never met any problem like this..!!
    and i already use adobe flash player higher than version 10
    so how can i fix this problem..??

    Hi Scott,
    in SDIXML_DATA_TO_DOM you can only pass the name of root node, so you can not assign attribute xmlns to root node (<Data xmlns="ServiceNet">) ... unless you build the xml document from scratch (without SDIXML_DATA_TO_DOM)
    when using your sample code (without sale) I get xml without <item>
    SDIXML_DATA_TO_DOM => SDIXML_DOM_TO_SCREEN::
    <?xml version="1.0" encoding="utf-8" ?>
    - <Data>
      <LV_XMINS>xmlns="DUMMY FIELD</LV_XMINS>
      <BATCHDATETIME>2009-11-13T12:05:58</BATCHDATETIME>
      </Data>
    regards, Karsten

  • File Upload Problem from Linux to Windows and Windows to Linux

    Hi,
    I am a newbie in the flex environment.
    I have faced a problem for file upload from linux to windows and windows to linux
    And I have put crossdomain.xml file in root folder, still this problem is appear.
    Please help me, if anybody know the answer.
    Thanks and Regards,
    Senthil KUmar

    Hi Pauley,
    I thought you are moving from unix to windows. Now I got it.
    Make sure that the folder is shared and have necessary permissions. Please see few suggestions here:
    Re: NFS or FTP for file on Ip 10.x.y.z
    Regards,
    ---Satish

  • Problem with Sessions and window.open

    Hi,
    Hi everyone,
    Help Please!!!
    I am working with Sevlet session objects and HTML forms and windows. I have an HTML form for the user to supply a username and password. Once the user clicks submit I need to open another browser window that has no toolbar, no location, no status bar, etc. The user should also be able to go back to that login screen and login again and open a 2nd, 3rd, etc. instance of the application. My problem is that each application is being asigned the same sessionId. I believe it is being asigned to the main login window and thus to the other child windows it opens. Is there a way to work around this? Do I need to make the user open another browser window to login? I need to be able to let the user open multiple instances of the application with unique session ids for each.
    Any insight is GREATLY appreciated on this topic. Anything you can tell me about sessions (Java), IE, window.open would help greatly!
    THANK YOU IN ADVANCE!!!
    MA

    To achieve this, you must introduce another level of
    abstraction to the Servlet specifications. When you
    work with JSP/Servlets you use mostly the HttpSession
    to handle user related tasks, and the aplication
    context, for things that are common to all users. But
    inside the HttpSession scope, you want to create
    containers that have 'smaller' scope and are uniquely
    identified.
    A ipothetical scenario :Let's say that you must have
    multiple connections to several databases, on each
    database user rights beeing diferrent, and you must be
    able to track user actions globaly, and eventualy
    capture a 'Close Application event' and close all db.
    connections.
    1. when the user first accesses the login frame create
    the HttpSession. In the HttpSession object, store a
    Hastable (let's call it 'ConnectionTable'). Each
    object in the Hashtable must identify uniqely a
    database connection. Now, to create unique identifiers
    ids, make the keys in the hashtable java.lang.Long
    objects, created using System.getCurrentTimeMillis().
    This guaranties there will be no possible confusion.
    From each new open window, on each request to the
    server, along with the usefull parameters, send the
    connection identifier. When proccessing the request,
    select the object from the Hastable wich corresponds
    to the ID.
    2. Now, the values in the ConnectionTable, must act as
    the containers that I mentioned in the first
    paragraph. The simplest way to do this is to have
    again a Hashtable derived class to do the job, wich
    exploses methods similar to HttpSession: setAttibute (
    Object key, Object value) and getAttibute ( Object
    key, Object value). This container may use internally
    a Hashtable to store object, and explose only the
    getAttribute and setAttribute methods for clarity. Any
    way, this is a problem of implementation. Let's call
    this class CustomSession.
    Now, a textual activity diagram:
    1 user accesses the main page, you start a new
    HttpSession; In the HttpSession object, store the
    ConnectionTable object.
    2. the user enters the userID and pwd and adatabase
    name, and a new window is opened. Let's supose the
    data entered is valid.
    3. when you process the login data, you create a new
    CustomSession object. you put in it whatever you would
    put in your HttpSession. You generate a unique
    identifier using System.CurrentTimeMillis(). Put the
    CustomSession object in the ConnectionTable, using the
    generated id as key. Send the response.
    ..... later on .....
    100. the user asks for a particular action to be
    performed - e.g. a row deletion. The page contains a
    form with text field where the user introduces the
    row number, a submit button and a hidden input with
    the ID.
    101. you process the data. Get the ID from the request
    object, get the ConnectionTable from the session, get
    the CustomSession using the ID as key, do whatever
    your logic was doing, but obtaining the objects from
    the CustomSession instead of HttpSession
    NicNic,
    Very slick idea. I think that it could work and it seems that there would be not security issues because the id that you would store on the client side is the Unique Identifier and not the actual Session Id. Do you forsee any security issues for this implementation?

  • Is Verizon going to acknowlege the problems with FIOS and Windows Vista

    For months now, I have been reading the numerous problems Fios internet customers are having with Fios internet/Actiontech Router and Windows Vista and there has been no acknowledgement by Verizon of this current major issue.
    I have also experienced the exact same issue for months now since I switched to Verizon FIOS internet. Previously I had Comcast HSI using my Windows Vista laptop.  I had their service for over a year and I NEVER has a problem with the Windows Vista globe icon disappearing and loosing internet connection. The Globe always stayed on and never went away and I never lost connection when I had Comcast
    I had Verizon FIOS installed last September with my Windows Vista computer and my wireless internet connection started to drop from day 1 and it has been a daily occurrence for over 5 months now.  It has gotten so bad, I have had to hardwire my laptop to to be able to use the internet uninterrupted.
    This is what daily scenario is:
    When I turn on my laptop(with Windows Vista, I can initially get full internet access(with the globe on and it says "Local and internet). After about 10 minutes or less, the globe switches to "local only" and I can still get  internet access.  After another 5 or so minutes, a large X covers the globe and I lose internet connection entirely. The actiontech router wireless signal is no longer listed as one of the wireless networks.  The only way for me to regain internet access is either to restart my laptop or reboot the actiontech router.
    Numeorus posts here, over by DSL forums(Broadband Reports),Microsoft's website and a few othere websites detail this issue.
    I am extremely shocked and surprised that Verizon has not tried to fix this issue by working with both the makers of the Actiontech Router as well as Microsoft to find out what the problem is and how to fix it.
    I would just like to reiterate I strongly believe this is primarily a FIOS internet issue since I previously had Comcast HSI for over a year with the same Windows Vista laptop and I NEVER had that problem. Also,  I can connect to my neighbors wireless connection(she uses Comcast HSI) and when I do, the globe stay on all the time on my computer and the internet does not lose connection.
    I know that there are a couple of Verizon employees here. Please tell the higher ups who handle FIOS internet that this is a major issue that needs to be resolved as soon as possible.
    P.S: Please don't tell me to go by my own router because then, I will have to deal with the issues of setting it up to work with Fios TV and the related VOD, widgets, remote DVR compatability issues to deal with. I don't think I can deal with the additional headaches. 

    FIOS is short for fiber optics.  fiber optics is different technology than DSL.   
    With that said, if you search the Microsoft databases for vista issues with fiber optics, (CURRENTLY THERE IS ONLY ONE PROVIDER OF FIBER TO THE HOUSE, that being Verizon, so yes you can also search Vista issues with verizon and\or fios) and you will find that Microsoft already acknowledges this issue with their software.  AND they offer you a fix.
    cjacobs001

  • Itunes and windows 8 compatability Hi just bought a new toshiba laptop installed itunes it worked at first now wont play music or movies.  ran troubleshooter said its a compatabilty problem suggested turning off itunes compatability or selecting windows 7

    itunes and windows 8 compatability
    Hi
    just bought a new toshiba laptop installed itunes it worked at first now wont play music or movies.
    ran troubleshooter said its a compatabilty problem suggested turning off itunes compatability or selecting windows service pack 3 tried both no help
    please assist
    adam

    itunes and windows 8 compatability
    Hi
    just bought a new toshiba laptop installed itunes it worked at first now wont play music or movies.
    ran troubleshooter said its a compatabilty problem suggested turning off itunes compatability or selecting windows service pack 3 tried both no help
    please assist
    adam

  • Problem dual booting Windows 8 and windows 7 G480

    I bought new laptop g480 and it comes with windows 8  single language and I want to dual boot it with windows 7 Ultimate. So I create one partition 50 Gig using Minitool Partition Wizard, after that I boot into USB device ( I've bootable Windows 7 USB and already disable secure boot in BIOS). The process went fine until it ask me where to install the windows, so I choose the partition 50 Gig I created before but I get this message "Windows cannot be installed to this disk of the GPT partition style". Help me guys how to solve this problem, I've searched solution for this but non of them seems working for me. Step by step will be good for me.  I hope to get quick reply for this because I've this problem since 2 days ago and never get solution .
    Thank you.
    Solved!
    Go to Solution.

    Hi @CharlyAR
    I tried your solution before I posted the message here but it didn't work but then I give it try again and I manage to install the Windows 7 ultimate. Now my pc dual boot with windows 7 and windows 8 (windows 8 is the main OS).
    p.s. This is important guys, if u want to make windows 7 bootable USB by following the tutorial on youtube it wont work if you pc/laptops is pure GPT (UEFI) because most of them  using MBR to make the tutorial thats why it look easy and works for them, it's almost same but there's "add-on" with GPT mode. You have to make the windows 7 bootable USB in GPT (UEFI) mode or it wont let you install. I couldn't find tutorial for this GPT mode on youtube.
    All I do is search my old DVD-RW and erase it and  I follow the tutorial here, same what @CharlyAR told me
    http://www.youtube.com/watch?v=z7rRsQGew28

  • Firefox crashes upon start with the error message: Firefox had a problem and crashed. We'll try to restore your tabs and windows when it restarts.

    I have tried to open firefox multipul times only to receive the error message:
    We're Sorry
    Firefox had a problem and crashed. We'll try to restore your tabs and windows when it restarts.
    To help us diagnose and fix the problem, you can send us a crash report.
    When I send the report and try to restart firefox and see that I have several tabs open, but it quickly shuts down again before I can do anything other then glance at it.

    http://kb.mozillazine.org/Firefox_crashes

Maybe you are looking for

  • Itunes cannot backup iphone because an error occurred

    itunes cannot backup iphone because an error occurred

  • Parse error does not return ORA error

    I had a query for a chart that would not parse and did not return an ORA- error to help me find the problem. After some trial and error I was able to identify the source of the error. I was passing a string to the TRUNC function and not a date. I wou

  • All the text I write with the text tool is small!

    I am not aware that I did anything weir. Either way, unless I put text size to 1000, the text isnt even visible. I'm not sure what could be wrong, so I took an image of it http://i278.photobucket.com/albums/kk101/notableman/Anotherphotoshopproblem.pn

  • IPhone SDK Simulator - How to uninstall application developed

    Hi, I downloaded the HelloWorld sample for iPhone SDK. Compiled and was able to run the application. How can I remove the just compiled app from the simulator? I even tried uninstalling the iPhone SDK and upon reinstalling it, I still see the icon in

  • Anchor tag inside Spry Tabbed Panel Content

    I have successful been able to use code I found listed on here to open a specific tab in a Spry Tabbed Panel form a link. Now I am wondering if anyone has found out how to add an anchor tag code this so that is goes to a specific location inside that