fix handling of empty string as encoding name
svn: r4015
This commit is contained in:
parent
ad6ac0eb57
commit
4aa398ef7c
|
@ -2240,7 +2240,7 @@ read_list(Scheme_Object *port,
|
||||||
if (effective_ch == closer) {
|
if (effective_ch == closer) {
|
||||||
if (shape == mz_shape_hash_elem) {
|
if (shape == mz_shape_hash_elem) {
|
||||||
scheme_read_err(port, stxsrc, startline, startcol, start, SPAN(port, start), ch, indentation,
|
scheme_read_err(port, stxsrc, startline, startcol, start, SPAN(port, start), ch, indentation,
|
||||||
"read: expected hash pair (with key and value separated by %s) before '%c'",
|
"read: expected hash pair (with key and value separated by %s) before `%c'",
|
||||||
dot_name(params),
|
dot_name(params),
|
||||||
ch);
|
ch);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -4075,11 +4075,14 @@ Scheme_Object *scheme_open_converter(const char *from_e, const char *to_e)
|
||||||
|
|
||||||
if (!iconv_ready) init_iconv();
|
if (!iconv_ready) init_iconv();
|
||||||
|
|
||||||
|
if (!*to_e || !*from_e)
|
||||||
|
reset_locale();
|
||||||
|
|
||||||
if ((!strcmp(from_e, "UTF-8")
|
if ((!strcmp(from_e, "UTF-8")
|
||||||
|| !strcmp(from_e, "UTF-8-permissive")
|
|| !strcmp(from_e, "UTF-8-permissive")
|
||||||
|| (!*from_e && mzLOCALE_IS_UTF_8(from_e)))
|
|| (!*from_e && mzLOCALE_IS_UTF_8(current_locale_name)))
|
||||||
&& (!strcmp(to_e, "UTF-8")
|
&& (!strcmp(to_e, "UTF-8")
|
||||||
|| (!*to_e && mzLOCALE_IS_UTF_8(to_e)))) {
|
|| (!*to_e && mzLOCALE_IS_UTF_8(current_locale_name)))) {
|
||||||
/* Use the built-in UTF-8<->UTF-8 converter: */
|
/* Use the built-in UTF-8<->UTF-8 converter: */
|
||||||
kind = mzUTF8_KIND;
|
kind = mzUTF8_KIND;
|
||||||
if (!strcmp(from_e, "UTF-8-permissive"))
|
if (!strcmp(from_e, "UTF-8-permissive"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user