Alright.
You want to convert the text into HTML entities.
This function should do it:
Private Sub SomeMethod()
Dim file As New StreamReader("filename", Encoding.GetEncoder(437))
Dim content As String
content = TextToHtmlEntity(file.ReadToEnd)
file.Close()
'content now contains a string of HTML entities
End Sub
Private Function TextToHtmlEntity(ByVal text As String) As String
Dim textVal As Integer
Dim encoded As String = ""
Dim c As Char
For Each c In text
textVal = AscW(c)
If textVal >= 49 And textVal <= 122 Then
encoded += c
Else
encoded += String.Concat("&#",
textVal.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), ";")
End If
Next
Return encoded
End Function