System.Text.UTF8Encoding? Unicode convert?!?
I'm writing VBA code embedded in an Excel spreadsheet.
I need to convert strings from Unicode UTF-8 to standard string objects.
If you read the MSDN docs, it looks like the way is the object System.Text.UTF8Encoding. But it SEEMS like there is no way to use it from the VBA world. It seems like it might be Visual Basic.NET only, but not exported to the VBA world. Is that true?!?!?
How the heck do I do this?
I can create VBA code that does createobject("System.Text.UTF8Encoding") which runs fine, but then the object that it creates can't take any messages. :-(
Dim myconverter
Set myconverter = CreateObject("System.Text.UTF8Encoding") ' no error
Dim encodedBytes
encodedBytes = myconverter.GetBytes("sdsf") ' THIS FAILS - no GetBytes
There is some commercial developer who licenses some DLL to do this from VBA/VBscript, but that seems ridiculous, and wouldn't work in my architecture anyway -- i need it all to be contained within the Excel file.
Any ideas?!?!
Thanks!
|