/***********************************************************
jconv.dllを簡単に利用するためのモジュール
【2006/12/29 更新】
●関数一覧
#defcfunc sjis_jis str p1 Shift-JISコードをJISコードに変換
#defcfunc sjis_eucjp str p1 Shift-JISコードをEUC-JPコードに変換
#defcfunc sjis_utf8 str p1 Shift-JISコードをUTF-8コードに変換
#defcfunc jis_sjis str p1 JISコードをShift-JISコードに変換
#defcfunc jis_eucjp str p1 JISコードをEUC-JPコードに変換
#defcfunc jis_utf8 str p1 JISコードをUTF-8コードに変換
#defcfunc eucjp_sjis str p1 EUC-JPコードをShift-JISコードに変換
#defcfunc eucjp_jis str p1 EUC-JPコードをJISコードに変換
#defcfunc eucjp_utf8 str p1 EUC-JPコードをUTF-8コードに変換
#defcfunc utf8_sjis str p1 UTF-8コードをShift-JISコードに変換
#defcfunc utf8_jis str p1 UTF-8コードをJISコードに変換
#defcfunc utf8_eucjp str p1 UTF-8コードをEUC-JPコードに変換
#defcfunc to_sjis str p1 未確認コードをshift-JISコードに変換
#defcfunc to_jis str p1 未確認コードをJISコードに変換
#defcfunc to_eucjp str p1 未確認コードをEUC-JPコードに変換
#defcfunc to_utf8 str p1 未確認コードをUTF-8コードに変換
***********************************************************/
#ifndef __GM_JCONV_DLL__
#define global __GM_JCONV_DLL__
#module jconv_dll
#uselib "jconv"
#func jconv "_jconv@20" int,sptr,int,int,sptr // 文字コード変換
;#func setjconvopt "setjconvopt" int// 0x20〜0x7eまでの文字コードをJIS X0201とするのか、US-ASCIIとするのかを調整
/* JC_JCODE_TYPE(jconv関数用定数) */
#const JC_AUTO 0
#const JC_UTF_7 1
#const JC_ISO2022JP 2
#const JC_UTF_8 3
#const JC_SHIFT_JIS 4
#const JC_EUC_JP 5
#const JC_UTF_16_B 6
#const JC_UTF_16_L 7
#const JC_UCS_4_B 8
#const TIMES_CONV_LEN 10
;/* JC_JCODE_OPT(setjconvopt関数用定数) */
;#const JO_SJIS_7BIT_ASCII 0
;#const JO_SJIS_7BIT_JIS 1
;#const JO_EUC_JP_7BIT_ASCII 2
;#const JO_EUC_JP_7BIT_JIS 3
#defcfunc sjis_jis str p1
gosub *set_prms
jconv JC_SHIFT_JIS, str_from, len, JC_ISO2022JP, str_to
return str_to_
#defcfunc jis_sjis str p1
gosub *set_prms
jconv JC_ISO2022JP, str_from, len, JC_SHIFT_JIS, str_to
return str_to_
#defcfunc sjis_eucjp str p1
gosub *set_prms
jconv JC_SHIFT_JIS, str_from, len, JC_EUC_JP, str_to
return str_to_
#defcfunc eucjp_sjis str p1
gosub *set_prms
jconv JC_EUC_JP, str_from, len, JC_SHIFT_JIS, str_to
return str_to_
#defcfunc eucjp_jis str p1
gosub *set_prms
jconv JC_EUC_JP, str_from, len, JC_ISO2022JP, str_to
return str_to_
#defcfunc jis_eucjp str p1
gosub *set_prms
jconv JC_ISO2022JP, str_from, len, JC_EUC_JP, str_to
return str_to_
#defcfunc sjis_utf8 str p1
gosub *set_prms
jconv JC_SHIFT_JIS, str_from, len, JC_UTF_8, str_to
return str_to_
#defcfunc utf8_sjis str p1
gosub *set_prms
jconv JC_UTF_8, str_from, len, JC_SHIFT_JIS, str_to
return str_to_
#defcfunc jis_utf8 str p1
gosub *set_prms
jconv JC_ISO2022JP, str_from, len, JC_UTF_8, str_to
return str_to_
#defcfunc utf8_jis str p1
gosub *set_prms
jconv JC_UTF_8, str_from, len, JC_ISO2022JP, str_to
return str_to_
#defcfunc eucjp_utf8 str p1
gosub *set_prms
jconv JC_EUC_JP, str_from, len, JC_UTF_8, str_to
return str_to_
#defcfunc utf8_eucjp str p1
gosub *set_prms
jconv JC_UTF_8, str_from, len, JC_EUC_JP, str_to
return str_to_
#defcfunc to_sjis str p1
gosub *set_prms
jconv JC_AUTO, str_from, len, JC_SHIFT_JIS, str_to
return str_to_
#defcfunc to_jis str p1
gosub *set_prms
jconv JC_AUTO, str_from, len, JC_ISO2022JP, str_to
return str_to_
#defcfunc to_eucjp str p1
gosub *set_prms
jconv JC_AUTO, str_from, len, JC_EUC_JP, str_to
return str_to_
#defcfunc to_utf8 str p1
gosub *set_prms
jconv JC_AUTO, str_from, len, JC_UTF_8, str_to
return str_to_
*set_prms
str_from_ = p1
str_from = varptr(str_from_)
len = strlen(str_from_)
sdim str_to_, len * TIMES_CONV_LEN + 4
str_to = varptr(str_to_)
return
#global
#endif
|