ftpfs: dont convert names to latin when string is valid utf-8
This commit is contained in:
parent
7cc757c3c0
commit
7ae4e473da
1 changed files with 5 additions and 2 deletions
|
@ -1517,14 +1517,17 @@ fromlatin1(char *from)
|
|||
{
|
||||
char *p, *to;
|
||||
Rune r;
|
||||
int n;
|
||||
|
||||
if(os == Plan9)
|
||||
return nil;
|
||||
|
||||
/* don't convert if we don't have to */
|
||||
for(p = from; *p; p++)
|
||||
if(*p & 0x80)
|
||||
for(p = from; *p; p += n){
|
||||
n = chartorune(&r, p);
|
||||
if(r == Runeerror)
|
||||
break;
|
||||
}
|
||||
if(*p == 0)
|
||||
return nil;
|
||||
|
||||
|
|
Loading…
Reference in a new issue