diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-01 16:06:38 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-12-01 16:06:38 +0000 |
commit | 4813cb6776a1c73bf8e5fea4eec861bb5aec7467 (patch) | |
tree | b1964c427038c0a35c6af569d039417f3d310034 /Build/source/texk/kpathsea/knj.h | |
parent | d1f96f6033d08c0e712307ddc9bc1f63a8540742 (diff) |
Support KANJI file name in (e)upTeX on Windows (T. Tanaka)
git-svn-id: svn://tug.org/texlive/trunk@32290 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/knj.h')
-rw-r--r-- | Build/source/texk/kpathsea/knj.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/knj.h b/Build/source/texk/kpathsea/knj.h index 8f1cd919687..2f5b6b2a8d4 100644 --- a/Build/source/texk/kpathsea/knj.h +++ b/Build/source/texk/kpathsea/knj.h @@ -1,6 +1,7 @@ /* knj.h: check for 2-Byte Kanji (CP 932, SJIS) codes. Copyright 2010, 2011 Akira Kakuto. + Copyright 2013 TANAKA Takuji. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,10 +24,22 @@ extern "C" { #endif extern KPSEDLL int is_cp932_system; +extern KPSEDLL int file_system_codepage; extern KPSEDLL int isknj(int c); extern KPSEDLL int isknj2(int c); +extern KPSEDLL wchar_t* get_wstring_from_utf8(const char *mbstr, wchar_t *wstr); +extern KPSEDLL wchar_t* get_wstring_from_fsyscp(const char *mbstr, wchar_t *wstr); +extern KPSEDLL wchar_t* get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr); + +extern KPSEDLL char* get_utf8_from_wstring(const wchar_t *wstr, char mbstr); +extern KPSEDLL char* get_fsyscp_from_wstring(const wchar_t *wstr, char mbstr); +extern KPSEDLL char* get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr); + +extern KPSEDLL FILE* fsyscp_xfopen(const char *filename, const char *mode); + //extern KPSEDLL FILE* fsyscp_xfopen(const_string filename, const_string mode); + #ifdef __cplusplus } #endif @@ -34,4 +47,13 @@ extern KPSEDLL int isknj2(int c); /* True if P points to a 2-Byte Kanji (CP 932, SJIS) code. */ #define IS_KANJI(p) is_cp932_system && isknj(*(p)) && isknj2(*(p+1)) +/* Get wide string from multibyte string in UTF-8 */ +#define get_wstring_from_utf8(mb,w) get_wstring_from_mbstring(CP_UTF8,mb,w) +/* Get multibyte string in UTF-8 from wide string */ +#define get_utf8_from_wstring(w,mb) get_mbstring_from_wstring(CP_UTF8,w,mb) +/* Get wide string from multibyte string in file system codepage */ +#define get_wstring_from_fsyscp(mb,w) get_wstring_from_mbstring(file_system_codepage,mb,w) +/* Get multibyte string in file system codepage from wide string */ +#define get_fsyscp_from_wstring(w,mb) get_mbstring_from_wstring(file_system_codepage,w,mb) + #endif /* not KPATHSEA_KNJ_H */ |