Separate sj4charset

This commit is contained in:
Nishi 2026-06-25 09:25:46 +09:00
commit a76707537f
9 changed files with 381 additions and 340 deletions

View file

@ -0,0 +1,15 @@
#ifndef __SJ_CHARSET_H__
#define __SJ_CHARSET_H__
#include <sj_types.h>
#include <wchar.h>
int sj4_from_sjis(u_char* out, const u_char* in, int len);
int sj4_from_utf8(u_char* out, const u_char* in, int len);
int sj4_from_utf16(u_char* out, const u_char* in, int len);
int sj4_to_sjis(u_char* out, const u_char* in, int len);
int sj4_to_utf8(u_char* out, const u_char* in, int len);
int sj4_to_utf16(u_char* out, const u_char* in, int len);
#endif

View file

@ -0,0 +1,27 @@
#ifndef __SJ_EUC2UCS_H__
#define __SJ_EUC2UCS_H__
/*
* file:euc_jp_to_utf16_table.h
*/
/*
# EUC-JP Unicode
# Character Code Mappings
# <EUC-JP>
# <制御コード>0x000x1f, 0x7f</制御コード>
# <ASCII文字>0x200x7e</ASCII文字>
# <半角カタカナ>0x8ea10x8edf</半角カタカナ>
# <漢字>0xa1a10xf4a6, 0x8fa2af0x8fede3<漢字>
# </EUC-JP>
*/
struct _E2U_BITMAP_INDEX {
unsigned char byType; /* 1:isEmpty 2:BitmapIndex 3:Data */
unsigned long dwBitmapIndex; /* BitmapIndexへのポインタ(0の場合はBitmapIndexが存在しない) */
unsigned long dwEucJpCode; /* EUC_JP コード(未知の場合には0) */
unsigned long dwUtf16Code; /* UTF16コード(未知の場合には0) */
};
typedef struct _E2U_BITMAP_INDEX T_E2U_BITMAP_INDEX;
extern const T_E2U_BITMAP_INDEX euc_jp_to_utf16_table[];
#endif

View file

@ -0,0 +1,27 @@
#ifndef __SJ_UCS2EUC_H__
#define __SJ_UCS2EUC_H__
/*
* file:utf16_to_euc_jp_table.h
*/
/*
# Unicode EUC-JP
# Character Code Mappings
# <EUC-JP>
# <制御コード>0x000x1f, 0x7f</制御コード>
# <ASCII文字>0x200x7e</ASCII文字>
# <半角カタカナ>0x8ea10x8edf</半角カタカナ>
# <漢字>0xa1a10xf4a6, 0x8fa2af0x8fede3<漢字>
# </EUC-JP>
*/
struct _U2E_BITMAP_INDEX {
unsigned char byType; /* 1:isEmpty 2:BitmapIndex 3:Data */
unsigned long dwBitmapIndex; /* BitmapIndexへのポインタ(0の場合はBitmapIndexが存在しない) */
unsigned long dwEucJpCode; /* EUC_JP コード(未知の場合には0) */
unsigned long dwUtf16Code; /* UTF16コード(未知の場合には0) */
};
typedef struct _U2E_BITMAP_INDEX T_U2E_BITMAP_INDEX;
extern const T_U2E_BITMAP_INDEX utf16_to_euc_jp_table[];
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long