mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
cp_to_unicode: Simplify and cleanup
This commit is contained in:
parent
c5005ceeb3
commit
8a8fc52eec
@ -525,17 +525,17 @@ cp2utf_8(int from, int c)
|
|||||||
unicode_val_T
|
unicode_val_T
|
||||||
cp_to_unicode(int codepage, unsigned char **string, unsigned char *end)
|
cp_to_unicode(int codepage, unsigned char **string, unsigned char *end)
|
||||||
{
|
{
|
||||||
|
unicode_val_T ret;
|
||||||
|
|
||||||
if (is_cp_utf8(codepage))
|
if (is_cp_utf8(codepage))
|
||||||
return utf_8_to_unicode(string, end);
|
return utf_8_to_unicode(string, end);
|
||||||
else {
|
|
||||||
if (*string >= end)
|
if (*string >= end)
|
||||||
return UCS_NO_CHAR;
|
return UCS_NO_CHAR;
|
||||||
else {
|
|
||||||
unicode_val_T ret = cp2u(codepage, **string);
|
ret = cp2u(codepage, **string);
|
||||||
++*string;
|
++*string;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_UTF_8 */
|
#endif /* CONFIG_UTF_8 */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user