6361 |
|
|
6362 |
if (SYMBOLP (coding->pre_write_conversion) |
if (SYMBOLP (coding->pre_write_conversion) |
6363 |
&& !NILP (Ffboundp (coding->pre_write_conversion))) |
&& !NILP (Ffboundp (coding->pre_write_conversion))) |
6364 |
str = run_pre_post_conversion_on_str (str, coding, 1); |
{ |
6365 |
|
str = run_pre_post_conversion_on_str (str, coding, 1); |
6366 |
|
/* As STR is just newly generated, we don't have to copy it |
6367 |
|
anymore. */ |
6368 |
|
nocopy = 1; |
6369 |
|
} |
6370 |
|
|
6371 |
from = 0; |
from = 0; |
6372 |
to = SCHARS (str); |
to = SCHARS (str); |
6374 |
|
|
6375 |
/* Encoding routines determine the multibyteness of the source text |
/* Encoding routines determine the multibyteness of the source text |
6376 |
by coding->src_multibyte. */ |
by coding->src_multibyte. */ |
6377 |
coding->src_multibyte = STRING_MULTIBYTE (str); |
coding->src_multibyte = SCHARS (str) < SBYTES (str); |
6378 |
coding->dst_multibyte = 0; |
coding->dst_multibyte = 0; |
6379 |
if (! CODING_REQUIRE_ENCODING (coding)) |
if (! CODING_REQUIRE_ENCODING (coding)) |
6380 |
{ |
goto no_need_of_encoding; |
|
coding->consumed = SBYTES (str); |
|
|
coding->consumed_char = SCHARS (str); |
|
|
if (STRING_MULTIBYTE (str)) |
|
|
{ |
|
|
str = Fstring_as_unibyte (str); |
|
|
nocopy = 1; |
|
|
} |
|
|
coding->produced = SBYTES (str); |
|
|
coding->produced_char = SCHARS (str); |
|
|
return (nocopy ? str : Fcopy_sequence (str)); |
|
|
} |
|
6381 |
|
|
6382 |
if (coding->composing != COMPOSITION_DISABLED) |
if (coding->composing != COMPOSITION_DISABLED) |
6383 |
coding_save_composition (coding, from, to, str); |
coding_save_composition (coding, from, to, str); |
6393 |
if (from == to_byte) |
if (from == to_byte) |
6394 |
{ |
{ |
6395 |
coding_free_composition_data (coding); |
coding_free_composition_data (coding); |
6396 |
return (nocopy ? str : Fcopy_sequence (str)); |
goto no_need_of_encoding; |
6397 |
} |
} |
6398 |
shrinked_bytes = from + (SBYTES (str) - to_byte); |
shrinked_bytes = from + (SBYTES (str) - to_byte); |
6399 |
} |
} |
6438 |
coding_free_composition_data (coding); |
coding_free_composition_data (coding); |
6439 |
|
|
6440 |
return newstr; |
return newstr; |
6441 |
|
|
6442 |
|
no_need_of_encoding: |
6443 |
|
coding->consumed = SBYTES (str); |
6444 |
|
coding->consumed_char = SCHARS (str); |
6445 |
|
if (STRING_MULTIBYTE (str)) |
6446 |
|
{ |
6447 |
|
if (nocopy) |
6448 |
|
/* We are sure that STR doesn't contain a multibyte |
6449 |
|
character. */ |
6450 |
|
STRING_SET_UNIBYTE (str); |
6451 |
|
else |
6452 |
|
{ |
6453 |
|
str = Fstring_as_unibyte (str); |
6454 |
|
nocopy = 1; |
6455 |
|
} |
6456 |
|
} |
6457 |
|
coding->produced = SBYTES (str); |
6458 |
|
coding->produced_char = SCHARS (str); |
6459 |
|
return (nocopy ? str : Fcopy_sequence (str)); |
6460 |
} |
} |
6461 |
|
|
6462 |
|
|