Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > UTF-8 encoding problem

Reply
Thread Tools

UTF-8 encoding problem

 
 
shreshth.luthra@gmail.com
Guest
Posts: n/a
 
      10-18-2006
Hi All,

I am having a GUI which accepts a Unicode string and searches a given
set of xml files for that string.

Now, i have 2 XML files both of them saved in UTF-8 format, having
characters of different language.

Although both of them are having UTF-8 as BoM, but only first file is
having UTF-8 defined in XML declration at the top of the XML file as
well.

Now, when i search for some different langauge character in that
directory using a third party GUI for desktop search, it shows that the
charcter exist in the first file (in which XML declation was also
there), but not in the second file (having only BoM)

Initilally i thought that the problem is mainly because of UTF-8 being
supporting both MultiBye and Unicode, but could not find much on it,
because both of them had the same contents when opened in Binary mode
(Except for XML Declaration in 1 of them)
Please help.

Regards,
Shreshth

 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      10-18-2006
In article <(E-Mail Removed) .com>,
<(E-Mail Removed)> wrote:

>Although both of them are having UTF-8 as BoM, but only first file is
>having UTF-8 defined in XML declration at the top of the XML file as
>well.


Even without an xml declaration or BOM, the default encoding for XML
is UTF-8. Are you really opening files, or are the documents coming
from a web server that might be incorrectly serving them as, say,
Latin-1?

-- Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
encoding problem with BeautifulSoup - problem when writing parsedtext to file Greg Python 9 10-08-2011 03:30 PM
Reading Text File Encoding and converting to Perls internal UTF-8 encoding sln@netherlands.com Perl Misc 2 04-17-2009 11:22 PM
changing JVM encoding; setting -Dfile.encoding doesn't work pasmol@plusnet.pl Java 1 10-08-2004 09:50 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM
Problem encoding/decoding image Slade ASP .Net 1 06-25-2003 09:28 AM



Advertisments