0
0
mirror of https://github.com/vim/vim.git synced 2025-10-24 08:54:47 -04:00

patch 9.1.1223: wrong translation used for encoding failures

Problem:  wrong translation for encoding failures because of using
          literal "from" and "to" in the resulting error message
          (RestorerZ)
Solution: use separate error messages for errors "from" and "to"
          encoding errors.

fixes: #16898
closes: #16918

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-03-18 20:55:42 +01:00
parent 8ac0f73eb1
commit d5afc74403
6 changed files with 15 additions and 10 deletions

View File

@@ -1339,7 +1339,7 @@ f_blob2str(typval_T *argvars, typval_T *rettv)
vim_free(str);
if (converted_str == NULL)
{
semsg(_(e_str_encoding_failed), "from", from_encoding);
semsg(_(e_str_encoding_from_failed), from_encoding);
goto done;
}
}
@@ -1348,7 +1348,7 @@ f_blob2str(typval_T *argvars, typval_T *rettv)
{
if (!utf_valid_string(converted_str, NULL))
{
semsg(_(e_str_encoding_failed), "from", p_enc);
semsg(_(e_str_encoding_from_failed), p_enc);
vim_free(converted_str);
goto done;
}
@@ -1414,7 +1414,7 @@ f_str2blob(typval_T *argvars, typval_T *rettv)
str = convert_string(str, p_enc, to_encoding);
if (str == NULL)
{
semsg(_(e_str_encoding_failed), "to", to_encoding);
semsg(_(e_str_encoding_to_failed), to_encoding);
goto done;
}
}