Julius 4.2
マクロ定義 | 関数 | 変数
julius/charconv_win32.c

文字コード変換 (Win32 API + libjcode 使用) [詳細]

#include "app.h"
#include <windows.h>
#include <winnls.h>
#include "libjcode/jlib.h"

ソースコードを見る。

マクロ定義

#define UNICODE_BUFFER_SIZE   4096
 Buffer length to use for unicode conversion.

関数

boolean charconv_win32_setup (char *fromcode, char *tocode, boolean *enable_conv)
 Setup charset conversion for win32.
char * charconv_win32 (char *instr, char *outstr, int maxoutlen)
 Apply charset conversion to a string using win32 functions.

変数

static boolean euctosjis = FALSE
 TRUE if use libjcode for euc->sjis conv.
static boolean only_euc_conv = FALSE
 Perform only euc->sjis.
static unsigned int from_cp
 Source codepage.
static unsigned int to_cp
 Target codepage.
static wchar_t unibuf [UNICODE_BUFFER_SIZE]
 Local work area for unicode conversion.

説明

文字コード変換 (Win32 API + libjcode 使用)

Windows の WideCharToMultiByte() および MultiByteToWideChar() を 使用した文字コード変換を行う. "ansi" "oem" "mac" "utf-7" "utf-8" あるいは 任意のコードページ番号間の変換を,unicode を介して行う.

Windows では EUC のコードページに対応していないので,変換元の文字コードが euc-jp のときは,libjcode で SJIS に変換してからunicodeへ変換する.

作者:
Akinobu LEE
日付:
Thu Feb 17 16:02:41 2005
Revision:
1.4

charconv_win32.c で定義されています。


関数

boolean charconv_win32_setup ( char *  fromcode,
char *  tocode,
boolean enable_conv 
)

Setup charset conversion for win32.

引数:
fromcode[in] input charset code name or codepage number string, NULL invalid
tocode[in] output charset code name or codepage number string, or NULL when disable conversion
enable_conv[out] store whether conversion should be enabled or not
戻り値:
TRUE on success, FALSE on failure (unknown codename or unsupported codepage).

charconv_win32.c68 行で定義されています。

参照元 charconv_setup_real().

char* charconv_win32 ( char *  instr,
char *  outstr,
int  maxoutlen 
)

Apply charset conversion to a string using win32 functions.

引数:
instr[in] source string
outstr[in] destination buffer
maxoutlen[in] allocated length of outstr in byte.
戻り値:
either of instr or outstr, that holds the result string.

charconv_win32.c204 行で定義されています。

参照元 charconv().