VBScriptからどのようにGetBytes(System.Text.UTF8Encodingの)を呼び出すのですか?System.Text.UTF8Encoding From VBScript
あなたはcan use the .NET Framework from VBScriptとしてits exposed to COMと書かれていますが、私は良いドキュメンテーション/マニュアルを見つけていません。
VBScriptからどのようにGetBytes(System.Text.UTF8Encodingの)を呼び出すのですか?System.Text.UTF8Encoding From VBScript
あなたはcan use the .NET Framework from VBScriptとしてits exposed to COMと書かれていますが、私は良いドキュメンテーション/マニュアルを見つけていません。
あなたはVBScriptで同等を探しているなら、あなたは、ADOストリームを使用してそれを行うことができます:
Const adTypeBinary = 1
Dim adoStr, bytesthroughado
Set adoStr = CreateObject("Adodb.Stream")
adoStr.Charset = "utf-8"
adoStr.Open
adoStr.WriteText "你好Ğ"
adoStr.Position = 0 'reset position
adoStr.Type = adTypeBinary
adoStr.Position = 3 'skip bom
bytesthroughado = adoStr.Read 'get bytes
WScript.Echo LenB(bytesthroughado) 'length
adoStr.Close
Set adoStr = Nothing
それは、VBScriptから(mscorlibから)いくつかの.NETコンポーネントにアクセスすることが可能です。
Dim encoding, bytesthroughdotnet
Set encoding = CreateObject("System.Text.UTF8Encoding")
bytesthroughdotnet = encoding.GetBytes_4("你好Ğ") 'get bytes
WScript.Echo LenB(bytesthroughdotnet) 'length
Set encoding = Nothing
時代錯誤、恐竜と人間の映画のスタイル。タイムマシンを戻す[ComVisible]クラスを書くことができます。 –