Home > Software engineering >  Vb access to web content will be garbled why is this? Help me to look at the code to what is going w
Vb access to web content will be garbled why is this? Help me to look at the code to what is going w

Time:10-12

Access web page http://www.darkinblack.com/11.html, normal display content for
Kyyhkysm? Ki 3 B 20

But I use vb to access web content, to display
Kyyhkysm? Ki 3 B 20

Why is this? Coding issues? Need to how to convert? Thank you

Kyyhkysm ? 20 ki 3 B
Kyyhkysm ? 20 ki 3 B



My code is as follows

 Public Function getHtmlStr (strUrl As String) As String 
Dim XmlHttp As Object
The Set XmlHttp=CreateObject (" Microsoft. XmlHttp ")

XmlHttp. Open "GET", strUrl, False
On Error GoTo Err_net
XmlHttp. Send

GetHtmlStr=BytesToBstr (XmlHttp responseBody, "utf-8")

The Set XmlHttp=Nothing
Err_net:
End the Function


Private Function BytesToBstr (strBody codeBase) As String
Dim objStream As Object
The Set objStream=CreateObject (" Adodb. Stream ")
ObjStream. Type=1
ObjStream. Mode=3
ObjStream. Open
ObjStream. Write strBody
ObjStream. Position=0
ObjStream. Type=2
ObjStream. Charset=codeBase
BytesToBstr=objStream. ReadText
ObjStream. Close
The Set objStream=Nothing
End the Function

Private Sub Form_Load ()
The Debug. Print getHtmlStr (" http://www.darkinblack.com/11.html ")
End Sub

CodePudding user response:

Does anyone online ah, help me to look at, thank you

CodePudding user response:

With code it doesn't matter, is to display character of the problem, it should be adjusted according to the character set encoding in web page code font used in the library,

CodePudding user response:

refer to the second floor of123 response:
with code it doesn't matter, is to display character of the problem, it should be adjusted according to the character set encoding in web page code font library, used in the



Need to how to adjust? What need to install the Windows system?

CodePudding user response:

No, you can still use the browser controls to display these words:)

Also discussed in the BBS unicode related post, have mentioned controls and font, might as well search out to consult,

CodePudding user response:

Don't know much about,,, make uncertain

CodePudding user response:

Special characters use normal text box is displayed.

Try using RichTextBox, it should be able to show more characters.
  • Related