Reputation: 1501
I'm writing a simple script to build a HTML page to check if all the characters in UTF-8 are being rendered properly:
Dim oStream : Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.CharSet = "utf-8"
' Code writing out the top HTML snipped for brevity
Dim iChar
For iChar = 32 to 255
oStream.WriteText iChar & " = " & Chr(iChar) & "<br/>" & VbCrLf
Next
' Code writing out the bottom HTML snipped for brevity
oStream.SaveToFile "page.html", 2
Set oStream = Nothing
This works great, until I try and print characters beyond 255 in which case I get the error: Invalid procedure call or argument: 'Chr' (800A0005).
Can someone please explain how I can print all the characters within the UTF-8 character set?
The test is designed to see how the raw characters renders - so having a file with Ā
in it would not be a correct as it would need to print the actual Latin capital letter A with macron (Ā).
Upvotes: 2
Views: 2539