mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Sat Dec 22 15:45:45 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
* transcode_data_one_byte: slightly optimized * transcode_data_japanese: new data file for EUC-JP and SHIFT_JIS (not yet optimized; tests to follow; data from http://nkf.sourceforge.jp/ucm/{SJIS|eucJP}-nkf.ucm) * common.mk, transcode.c: Adjusted for transcode_data_japanese git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c9bf419684
commit
5ad8c5566d
4 changed files with 27475 additions and 73 deletions
14
transcode.c
14
transcode.c
|
@ -54,6 +54,12 @@ extern const BYTE_LOOKUP to_ISO_8859_13;
|
|||
extern const BYTE_LOOKUP to_ISO_8859_14;
|
||||
extern const BYTE_LOOKUP to_ISO_8859_15;
|
||||
|
||||
extern const BYTE_LOOKUP from_SHIFT_JIS;
|
||||
extern const BYTE_LOOKUP from_EUC_JP;
|
||||
|
||||
extern const BYTE_LOOKUP to_SHIFT_JIS;
|
||||
extern const BYTE_LOOKUP to_EUC_JP;
|
||||
|
||||
|
||||
/* declarations probably need to go into separate header file, e.g. transcode.h */
|
||||
|
||||
|
@ -69,7 +75,7 @@ typedef struct {
|
|||
/* todo: dynamic structure, one per conversion (stream) */
|
||||
|
||||
/* in the future, add some mechanism for dynamically adding stuff here */
|
||||
#define MAX_TRANSCODERS 29 /* todo: fix: this number has to be adjusted by hand */
|
||||
#define MAX_TRANSCODERS 33 /* todo: fix: this number has to be adjusted by hand */
|
||||
static transcoder transcoder_table[MAX_TRANSCODERS];
|
||||
|
||||
/* not sure why it's not possible to do relocatable initializations */
|
||||
|
@ -124,6 +130,12 @@ init_transcoder_table(void)
|
|||
register_transcoder("UTF-8", "ISO-8859-13", &to_ISO_8859_13, 1, 1);
|
||||
register_transcoder("UTF-8", "ISO-8859-14", &to_ISO_8859_14, 1, 1);
|
||||
register_transcoder("UTF-8", "ISO-8859-15", &to_ISO_8859_15, 1, 1);
|
||||
|
||||
register_transcoder("SHIFT_JIS", "UTF-8", &from_SHIFT_JIS, 3, 0);
|
||||
register_transcoder("EUC-JP", "UTF-8", &from_EUC_JP, 3, 0);
|
||||
register_transcoder("UTF-8", "SHIFT_JIS", &to_SHIFT_JIS, 2, 1);
|
||||
register_transcoder("UTF-8", "EUC-JP", &to_EUC_JP, 2, 1);
|
||||
|
||||
register_transcoder(NULL, NULL, NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue