文字変換ライブラリ StrConvDll は、文字変換機能を持つActiveXです。
他のプログラムから、以下の文字変換機能を使用することができるようになります。
StrConvDllSetup.exeを実行して、インストールしてください。
コントロールパネルの「アプリケーションの追加と削除」でアンインストールしてください。
VBScriptのサンプルコード
Dim sc
Set sc = CreateObject("StrConv.StrConv")
JScriptのサンプルコード
var sc = new ActiveXObject("StrConv.StrConv");
HRESULT _stdcall Hiragana([in] BSTR S, [out, retval] BSTR* Ret);
VBScriptのサンプルコード
MsgBox sc.Hiragana("アイウエオ")
JScriptのサンプルコード
WScript.Echo(sc.Hiragana("アイウエオ"));
HRESULT _stdcall Katakana([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.Katakana("あいうえお")
JScriptのサンプルコード
WScript.Echo(sc.Hiragana("あいうえお"));
HRESULT _stdcall FullWidth([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.FullWidth("abc")
JScriptのサンプルコード
WScript.Echo(sc.FullWidth("abc"));
HRESULT _stdcall HalfWidth([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.HalfWidth("abc")
JScriptのサンプルコード
WScript.Echo(sc.HalfWidth("abc"));
HRESULT _stdcall LowerCase([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.LowerCase("ABC")
JScriptのサンプルコード
WScript.Echo(sc.LowerCase("ABC"));
HRESULT _stdcall UpperCase([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.UpperCase("abc")
JScriptのサンプルコード
WScript.Echo(sc.LowerCase("ABC"));
HRESULT _stdcall FullKatanaka([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.FullKatanaka("カタカナ")
JScriptのサンプルコード
WScript.Echo(sc.FullKatanaka("カタカナ"));
HRESULT _stdcall EncodeHtml([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.EncodeHtml("<html>")
JScriptのサンプルコード
WScript.Echo(sc.EncodeHtml("<html>"));
HRESULT _stdcall DecodeHtml([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.DecodeHtml("<html>")
JScriptのサンプルコード
WScript.Echo(sc.DecodeHtml("<html>"));
HRESULT _stdcall EncodeUrl([in] BSTR S, [in] unsigned short CodePage, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.EncodeUrl("あいうえお", 932)
JScriptのサンプルコード
WScript.Echo(sc.EncodeUrl("あいうえお", 932));
HRESULT _stdcall DecodeUrl([in] BSTR S, [in] unsigned short CodePage, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.DecodeUrl("%82%A0%82%A2%82%A4%82%A6%82%A8", 932)
JScriptのサンプルコード
WScript.Echo(sc.DecodeUrl("%82%A0%82%A2%82%A4%82%A6%82%A8", 932));
先頭の文字を大文字に、それ以外の文字を小文字に変換します。
HRESULT _stdcall Capitalize([in] BSTR S, [out, retval] BSTR* RET);
VBScriptのサンプルコード
MsgBox sc.Capitalize("hello")
JScriptのサンプルコード
WScript.Echo(sc.Capitalize("hello"));
VBScriptのサンプルコード
'文字変換ライブラリをVBScriptから実行するサンプルプログラム
Dim sc
Set sc = CreateObject("StrConv.StrConv")
'ひらがなに変換する
MsgBox sc.Hiragana("アイウエオ")
'カタカナに変換する
MsgBox sc.Katakana("あいうえお")
'全角文字に変換する
MsgBox sc.FullWidth("abc")
'半角文字に変換する
MsgBox sc.HalfWidth("abc")
'小文字に変換する
MsgBox sc.LowerCase("ABC")
'大文字に変換する
MsgBox sc.UpperCase("abc")
'半角カナを全角に変換する
MsgBox sc.FullKatanaka("カタカナ")
'HTMLエスケープ
MsgBox sc.EncodeHtml("<html>")
'HTMLエスケープ解除
MsgBox sc.DecodeHtml("<html>")
'URLエスケープ(Shift_JIS)
MsgBox sc.EncodeUrl("あいうえお", 932)
'URLエスケープ(UTF8)
MsgBox sc.EncodeUrl("あいうえお", 65001)
'URLエスケープの解除(Shift_JIS)
MsgBox sc.DecodeUrl("%82%A0%82%A2%82%A4%82%A6%82%A8", 932)
'URLエスケープの解除(UTF-8)
MsgBox sc.DecodeUrl("%e3%81%82%e3%81%84%e3%81%86%e3%81%88%e3%81%8a", 65001)
'大文字で始める
MsgBox sc.Capitalize("hello")
Set sc = Nothing
フリーソフトとして公開します。転載については事前にメールで連絡してください。
このプログラムの使用により生じたいかなる損害についても保障することは出来ません。
本ソフトウェアについては、メールでのみサポートを受け付けています。
質問・要望・バグ報告・作者への励ましのメールは、yamamoto@gesource.jpまでお願いします。