mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
[project @ 2005-06-28 23:46:16 by jmb]
Using Iconv to convert between an encoding and itself is pretty pointless. svn path=/import/netsurf/; revision=1772
This commit is contained in:
parent
f2799e1058
commit
ed5a93caad
12
utils/utf8.c
12
utils/utf8.c
@ -248,6 +248,18 @@ utf8_convert_ret utf8_convert(const char *string, size_t len,
|
|||||||
|
|
||||||
assert(string && from && to && result);
|
assert(string && from && to && result);
|
||||||
|
|
||||||
|
if (strcasecmp(from, to) == 0) {
|
||||||
|
/* conversion from an encoding to itself == strdup */
|
||||||
|
slen = len ? len : strlen(string);
|
||||||
|
ret = strndup(string, slen);
|
||||||
|
if (!ret)
|
||||||
|
return UTF8_CONVERT_NOMEM;
|
||||||
|
|
||||||
|
*result = ret;
|
||||||
|
|
||||||
|
return UTF8_CONVERT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
in = (char *)string;
|
in = (char *)string;
|
||||||
|
|
||||||
cd = iconv_open(to, from);
|
cd = iconv_open(to, from);
|
||||||
|
Loading…
Reference in New Issue
Block a user