#1105 closed defect (fixed)
Multi-byte name problem Shift_JIS(Japanese)
Reported by: | yshobby | Owned by: | dkocher |
---|---|---|---|
Priority: | high | Milestone: | 2.8 |
Component: | core | Version: | 2.7.3 |
Severity: | major | Keywords: | Japanese Shift_JIS SJIS |
Cc: | Architecture: | ||
Platform: |
Description (last modified by dkocher)
Hi.
There are plural letter expression methods as a problem in specifications of Unicode.
Ex.
HIRAGANA LETTER BA : u3070 == u306f u3099
HIRAGANA LETTER PA : u3071 == u306f u309a
Local file system absorbs the problem. But Shift_JIS used server Problem.
However, a problem happens with a server using Shift_JIS for.
Ex. UTF -> Shift_JIS
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.
Change History (4)
comment:1 Changed on May 18, 2007 at 5:01:00 PM by dkocher
- Description modified (diff)
comment:2 Changed on Jun 25, 2007 at 7:05:26 AM by dkocher
comment:3 Changed on Jun 25, 2007 at 12:31:56 PM by dkocher
comment:4 Changed on Jul 1, 2007 at 11:52:11 PM by dkocher
- Milestone set to 2.8
- Resolution set to fixed
- Status changed from new to closed
Should be fixed in r3132. All filnames are now normalized.
Note: See
TracTickets for help on using
tickets.
http://www.icu-project.org/apiref/icu4j/com/ibm/icu/text/Normalizer.html may be of use here.