* transcode.c (transcode_loop): undefined character is replaced with
only one character. [ruby-dev:35709] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f1af3aed01
commit
95cd2c11b9
@ -1,3 +1,8 @@
|
|||||||
|
Fri Aug 1 23:26:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* transcode.c (transcode_loop): undefined character is replaced with
|
||||||
|
only one character. [ruby-dev:35709]
|
||||||
|
|
||||||
Fri Aug 01 23:26:22 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
Fri Aug 01 23:26:22 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
Merged r16430(akr), r16431(akr), r16433(akr), r16469(nobu), and
|
Merged r16430(akr), r16431(akr), r16433(akr), r16469(nobu), and
|
||||||
|
@ -186,6 +186,7 @@ transcode_loop(const unsigned char **in_pos, unsigned char **out_pos,
|
|||||||
unsigned char next_byte;
|
unsigned char next_byte;
|
||||||
int from_utf8 = my_transcoder->from_utf8;
|
int from_utf8 = my_transcoder->from_utf8;
|
||||||
unsigned char *out_s = out_stop - my_transcoder->max_output + 1;
|
unsigned char *out_s = out_stop - my_transcoder->max_output + 1;
|
||||||
|
rb_encoding *from_encoding = rb_enc_find(my_transcoder->from_encoding);
|
||||||
rb_encoding *to_encoding = rb_enc_find(my_transcoder->to_encoding);
|
rb_encoding *to_encoding = rb_enc_find(my_transcoder->to_encoding);
|
||||||
|
|
||||||
while (in_p < in_stop) {
|
while (in_p < in_stop) {
|
||||||
@ -277,6 +278,10 @@ transcode_loop(const unsigned char **in_pos, unsigned char **out_pos,
|
|||||||
/* valid character in from encoding
|
/* valid character in from encoding
|
||||||
* but no related character(s) in to encoding */
|
* but no related character(s) in to encoding */
|
||||||
/* todo: add more alternative behaviors */
|
/* todo: add more alternative behaviors */
|
||||||
|
{
|
||||||
|
int len = rb_enc_mbclen((const char *)char_start, (const char *)in_stop, from_encoding);
|
||||||
|
while (in_p < char_start + len) in_p++;
|
||||||
|
}
|
||||||
if (opt&UNDEF_IGNORE) {
|
if (opt&UNDEF_IGNORE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user