Problem in UTF-8 Byter Order Mark when updating using UNC

71 views
Skip to first unread message

Eko Suprapto Wibowo

unread,
Mar 31, 2013, 6:27:02 AM3/31/13
to nappu...@googlegroups.com
Hi,

First of all, thanks for your great library : it helps me a lot.

Now, I already success in updating using internet location. But when I use UNC in my windows networked drive, say \\Server\\UpdateLocation, I got confusing error about "Data at root level is invalid". Looking at this page in SO, http://stackoverflow.com/questions/291455/xml-data-at-root-level-is-invalid, I find a clue it got to be about it BOM. But, even though I already use/remove UTF-8 BOM using Notepad++, the library still remove the first char of my feed xml, which is a "<", this make the data invalid.

I attach a picture of UncSource.cs being debugged, with my stupid hack :D

I am using Windows 8 by the way, although I don't know whether it's mean something or not

Thanks!

Eko
08-utf-8.png

Itamar Syn-Hershko

unread,
Mar 31, 2013, 6:37:47 AM3/31/13
to nappu...@googlegroups.com
See http://stackoverflow.com/questions/2239968/c-sharp-file-readalltext-doing-weird-things

Basically, the handling of the BOM there is incorrect. If the file is saved as UTF8 and you remove the 2 conditions, it should work.

On another note, I believe I should change GetUpdatesFeed to return a stream and use FileStream instead, this will delegate the string processing to the reader / parser.




Eko

--
You received this message because you are subscribed to the Google Groups "NAppUpdate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nappupdate+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Eko S.Wibowo

unread,
Mar 31, 2013, 10:10:04 AM3/31/13
to nappu...@googlegroups.com
I see.

Thanks for that SO link.
I just get in touch with encoding issue. But surely the bottom line
from that SO link is : "...ideally you should know the encoding before
you open the file...".

Thanks Itamar!
- Eko

--
*Eko S. Wibowo*
----------------------
A Happy oDesk Remote Freelancer
http://bit.ly/join-odesk
Reply all
Reply to author
Forward
0 new messages