Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the content of a URL
Message
De
02/10/2006 13:49:29
 
 
À
01/10/2006 18:24:44
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01158458
Message ID:
01158621
Vues:
19
Why not UTF-8 since all sequences of characters in the ASCII set is encoded in UTF-8 in the same sequence of bytes as it would be in ASCII. Also, the first byte is sufficient to determine exactly how many additional bytes are required for the whole character to be decoded (if any additional bytes will be required). I thought most classes used UTF-8 by default if no encoding was specified?


>I have this code to get the content of a URL:
>
>
>        ' Get the HTML response from a server
>        ' expC1 Url
>        Public Function GetUrl(ByVal tcUrl As String) As String
>            Dim lcHTML As String
>            Dim loHTTP As System.Net.WebClient = New System.Net.WebClient
>            Dim loEncoding As System.Text.Encoding = New System.Text.ASCIIEncoding
>            Dim loRequestedHTML() As Byte
>            Try
>                loRequestedHTML = loHTTP.DownloadData(tcUrl)
>                lcHTML = loEncoding.GetString(loRequestedHTML)
>            Catch loError As Exception
>                lcHTML = loError.Message
>            End Try
>            Return lcHTML
>        End Function
>
>
>I am wondering about the declaration of the loEncoding. I put ASCIIEncoding for now. But, when getting the content of a URL, is that the proper encoding to use?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform