mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-24 23:56:49 +03:00
iconv: fix case for target and source encoding being same
git-svn-id: svn://kolibrios.org@6894 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a4a06a81a0
commit
950ddc2a93
@ -109,6 +109,20 @@ size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft,
|
||||
case UTF_8: wctomb=utf8_wctomb; break;
|
||||
default: return -3;
|
||||
}
|
||||
|
||||
if(from == to) {
|
||||
int oc=0,ic=0;
|
||||
|
||||
while(*inbytesleft > 0 && *outbytesleft > 0) {
|
||||
str[oc]=(*inbuf)[ic];
|
||||
++ic;
|
||||
++oc;
|
||||
(*inbytesleft)--;
|
||||
(*outbytesleft)--;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
count1=0;
|
||||
count2=0;
|
||||
|
Loading…
Reference in New Issue
Block a user