PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Reading a Webpage Source with Cyrillic Characters

Reply

Reading a Webpage Source with Cyrillic Characters

 
Thread Tools Rate Thread
Old 04-04-2006, 06:02 AM   #1
memzback@gmail.com
Guest
 
Posts: n/a
Default Reading a Webpage Source with Cyrillic Characters


Hi all, And thanks for taking a look at my post.

I'm trying to input the source of a website into a string in Visual
Basic 2005.


Heres the code


Public Function GetPageHTML(ByVal URL As String) As String
' Retrieves the HTML from the specified URL
Dim objWC As New System.Net.WebClient()
Return New
System.Text.UTF8Encoding().GetString(objWC.DownloadData(URL))
End Function


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button2.Click

TextBox2.AppendText(GetPageHTML("http://www.russiandvd.com/store/product.asp?sku=41383&genreid="))

End Sub


It gets the source correctly, but does not display the actual russian
chracters in the HTML code. I've tried changing the Encoding but to no
avail.


If someone can please offer some advice, I'd be very grateful.
Thanks

  Reply With Quote
Old 04-04-2006, 07:53 AM   #2
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: Reading a Webpage Source with Cyrillic Characters

MemzBack,

Have a look at these pages.

Encoding (GetEncoding)
http://msdn.microsoft.com/library/d...codingtopic.asp

General
http://www.microsoft.com/globaldev/...nce/cphome.mspx

OS systems
http://www.microsoft.com/globaldev/...locversion.mspx

I hope this helps a little bit?

Cor


  Reply With Quote
Old 04-04-2006, 10:26 AM   #3
Andrew Morton
Guest
 
Posts: n/a
Default Re: Reading a Webpage Source with Cyrillic Characters

memzback@gmail.com wrote:
<snip encoding woes)
> TextBox2.AppendText(GetPageHTML("http://www.russiandvd.com/store/product.asp?sku=41383&genreid="))


The encoding/charset for that page is ISO-8859-5.
Unless you switch to the English version, which is ISO-8859-1.

Andrew


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off