@@ -39,6 +39,7 @@ typedef struct _mbfl_filt_conv_wchar_cp50220_ctx {
39
39
static void mbfl_filt_conv_wchar_cp50220_ctor (mbfl_convert_filter * filt );
40
40
static void mbfl_filt_conv_wchar_cp50220_dtor (mbfl_convert_filter * filt );
41
41
static void mbfl_filt_conv_wchar_cp50220_copy (mbfl_convert_filter * src , mbfl_convert_filter * dest );
42
+ static int mbfl_filt_conv_cp5022x_wchar_flush (mbfl_convert_filter * filter );
42
43
43
44
const mbfl_encoding mbfl_encoding_jis_ms = {
44
45
mbfl_no_encoding_jis_ms ,
@@ -121,7 +122,7 @@ const struct mbfl_convert_vtbl vtbl_cp50220_wchar = {
121
122
mbfl_filt_conv_common_ctor ,
122
123
NULL ,
123
124
mbfl_filt_conv_jis_ms_wchar ,
124
- mbfl_filt_conv_common_flush ,
125
+ mbfl_filt_conv_cp5022x_wchar_flush ,
125
126
NULL ,
126
127
};
127
128
@@ -161,7 +162,7 @@ const struct mbfl_convert_vtbl vtbl_cp50221_wchar = {
161
162
mbfl_filt_conv_common_ctor ,
162
163
NULL ,
163
164
mbfl_filt_conv_jis_ms_wchar ,
164
- mbfl_filt_conv_common_flush ,
165
+ mbfl_filt_conv_cp5022x_wchar_flush ,
165
166
NULL ,
166
167
};
167
168
@@ -181,7 +182,7 @@ const struct mbfl_convert_vtbl vtbl_cp50222_wchar = {
181
182
mbfl_filt_conv_common_ctor ,
182
183
NULL ,
183
184
mbfl_filt_conv_jis_ms_wchar ,
184
- mbfl_filt_conv_common_flush ,
185
+ mbfl_filt_conv_cp5022x_wchar_flush ,
185
186
NULL ,
186
187
};
187
188
@@ -369,6 +370,15 @@ mbfl_filt_conv_jis_ms_wchar(int c, mbfl_convert_filter *filter)
369
370
return c ;
370
371
}
371
372
373
+ static int mbfl_filt_conv_cp5022x_wchar_flush (mbfl_convert_filter * filter )
374
+ {
375
+ if ((filter -> status & 0xF ) == 1 ) {
376
+ /* 2-byte (JIS X 0208 or 0212) character was truncated */
377
+ CK ((* filter -> output_function )(filter -> cache | MBFL_WCSGROUP_THROUGH , filter -> data ));
378
+ }
379
+ return 0 ;
380
+ }
381
+
372
382
/*
373
383
* wchar => JIS
374
384
*/
0 commit comments