[Cyberduck-trac] [Cyberduck] #1105: Multi-byte name problem Shift_JIS(Japanese)
Cyberduck
trac at trac.cyberduck.ch
Mon Apr 23 07:52:56 CEST 2007
#1105: Multi-byte name problem Shift_JIS(Japanese)
---------------------+------------------------------------------------------
Reporter: yshobby | Owner: dkocher
Type: defect | Status: new
Priority: high | Milestone:
Component: core | Version: 2.7.3
Severity: major | Keywords: Japanese Shift_JIS SJIS
---------------------+------------------------------------------------------
Hi.
There are plural letter expression methods as a problem in specifications
of Unicode. [[BR]]
Ex. [[BR]]
HIRAGANA LETTER BA : u3070 == u306f u3099[[BR]]
HIRAGANA LETTER PA : u3071 == u306f u309a[[BR]]
Local file system absorbs the problem. But Shift_JIS used server Problem.
However, a problem happens with a server using Shift_JIS for.[[BR]]
Ex. UTF -> Shift_JIS[[BR]]
u3070 -> 0x82ce[[BR]]
u306f u3099 -> 0x82cd 0x3f(error)
I am not good at the Java language.
Therefore I do not understand the most suitable method, but deal by the
following methods.
ch.cyberduck.core.Path
public static String normalize(final String path) {
||
||
// Return the normalized path that we have completed[[BR]]
//return normalized;[[BR]]
String n="";[[BR]]
char chw = 0;[[BR]]
for(int i=0; i<normalized.length(); i++) {[[BR]]
char ch = normalized.charAt(i);[[BR]]
if(ch == 12441) { //
daku[[BR]]
chw += 1;[[BR]]
} else if(ch == 12442) { //
handaku[[BR]]
chw += 2;[[BR]]
} else {[[BR]]
if(chw != 0) {[[BR]]
n += chw;[[BR]]
}[[BR]]
chw = ch;[[BR]]
}[[BR]]
}[[BR]]
n += chw;[[BR]]
return n;[[BR]]
}
Please examine an appropriate method.
thanks.
--
Ticket URL: <http://trac.cyberduck.ch/ticket/1105>
Cyberduck <http://cyberduck.ch>
FTP and SFTP Browser for Mac OS X.
More information about the Cyberduck-trac
mailing list