[Gambas-user] Issue 282 in gambas: xmlreader.node.value charset problems

gambas at ...2524... gambas at ...2524...
Fri Jul 20 14:10:18 CEST 2012


Comment #5 on issue 282 by Kokok... at ...626...: xmlreader.node.value charset  
problems
http://code.google.com/p/gambas/issues/detail?id=282

Seems the issue is inside xmlreader, i tried this:

Public Sub Form_Open()
   Dim feed As String
   Dim reader As Xmlreader
   Dim foundindex As Integer
    
Shell "wget 'http://gdata.youtube.com/feeds/api/videos?q=&max-results=3&v=1&orderby=relevance&time=all_time&author=clad672'  
-O /tmp/wgetfeed.txt &>/dev/null" Wait
   feed = File.Load("/tmp/wgetfeed.txt")

   foundindex = InStr(feed, "a vos questions")
   Debug Mid(feed, foundindex - 10, 50)

   reader = New Xmlreader
   reader.FromString(feed)
   While Not reader.eof
     reader.Read()
     If reader.Node.Name = "#text" Then
       If reader.Node.value Like "*a vos questions*" Then Debug  
reader.Node.value
     Endif
     If reader.Node.Attributes.count > 0 Then reader.Read()
   Wend
End

Ad i've got this output:
FMain.Form_Open.11: 7 répond a vos questions n°1</title><content typ
FMain.Form_Open.18: Clad67 r�pond a vos questions n�1
FMain.Form_Open.18: Clad67 r�pond a vos questions n�1


Here on pastenbin:
http://pastebin.com/Uqt5pgh1

I dumped the feed on the disk via wget, and then i printed some relevant  
characters, and they seems ok,
but as soon as the same feed is parsed by xmlreader, it is corrupted.
Am i doing something wrong?




More information about the User mailing list