julius/charconv_win32.c File Reference

Character set conversion using Win32 MultiByte function + libjcode. More...

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

Go to the source code of this file.

Defines

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

Functions

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.

Variables

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.


Detailed Description

Character set conversion using Win32 MultiByte function + libjcode.

Perform character set conversion using Windows native API WideCharToMultiByte() and MultiByteToWideChar(). Conversion between codepages of "ansi" "oem" "mac" "utf-7" "utf-8" or codepage number supported at the running OS are supported using unicode.

Conversion from Japanese-euc ("euc-jp") is optionally supported by the libjcode library.

Author:
Akinobu LEE
Date:
Thu Feb 17 16:02:41 2005
Revision
1.1.1.1

Definition in file charconv_win32.c.


Function Documentation

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

Setup charset conversion for win32.

Parameters:
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
Returns:
TRUE on success, FALSE on failure (unknown codename or unsupported codepage).

Definition at line 68 of file charconv_win32.c.

Referenced by charconv_setup_real().

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

Apply charset conversion to a string using win32 functions.

Parameters:
instr [in] source string
outstr [in] destination buffer
maxoutlen [in] allocated length of outstr in byte.
Returns:
either of instr or outstr, that holds the result string.

Definition at line 204 of file charconv_win32.c.

Referenced by charconv().


Generated on Tue Dec 18 15:59:57 2007 for Julius by  doxygen 1.5.4