| 1004 | */ |
| 1005 | |
| 1006 | size_t convert_error_message(char *to, size_t to_length, CHARSET_INFO *to_cs, |
| 1007 | const char *from, size_t from_length, |
| 1008 | CHARSET_INFO *from_cs, uint *errors) |
| 1009 | { |
| 1010 | DBUG_ASSERT(to_length > 0); |
| 1011 | /* Make room for the null terminator. */ |
| 1012 | to_length--; |
| 1013 | |
| 1014 | if (!to_cs || to_cs == &my_charset_bin) |
| 1015 | to_cs= system_charset_info; |
| 1016 | uint32 cnv_length= my_convert_using_func(to, to_length, |
| 1017 | to_cs, |
| 1018 | to_cs->cset->wc_to_printable, |
| 1019 | from, from_length, |
| 1020 | from_cs, from_cs->cset->mb_wc, |
| 1021 | errors); |
| 1022 | DBUG_ASSERT(to_length >= cnv_length); |
| 1023 | to[cnv_length]= '\0'; |
| 1024 | return cnv_length; |
| 1025 | } |
| 1026 | |
| 1027 | |
| 1028 | /** |
no test coverage detected