Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.2k views
in Java FTP by (240 points)
I found the unusual format of date.
A FTP server(UNIX) returns like below for 'LIST' command.
-rwxrwxrwx 1 URM dan 957 1월 7 09:22 test.txt
In that server, using 'dirDetails', filename is not returned.
I think that caused by the string, '1월'.
Because the first character is digit, it seems to enter below 'if'.
-----------------------------------------------------------------------------------------
// we expect the month first on Unix.
// Connect:Enterprise UNIX has a weird extra field here - we test if the
// next field starts with a digit and if so, we skip it
if (Character.isDigit(fields[index].charAt(0)))
index++;
-----------------------------------------------------------------------------------------
The 'if' condition must be contained more condition.
'1월' is the Korean and means 'January' in English.
Please fix the problem.
Thanks.

7 Answers

0 votes
by (51.6k points)
Have you tried setting the locale to Korean (i.e. ko_KR)?
ftpClient.setParserLocales(new Locale[] { Locale.KOREAN });


- Hans (EnterpriseDT)
0 votes
by (240 points)
Yes, I have tried setting the locale to Korean or Korea.
I think it's not 'Locale' problem but 'if' condition structure for 'Enterprise Unix Server'.

Thanks.
0 votes
by (51.6k points)
Alright when I looked into a bit more I see what you're talking about.

Basically you're saying that instead of 'Jan' and 'Feb', in Korean you get '1월' and '2월'. So instead of ignoring everything starting with a digit here, we should check to see if there's a '월' after the digit. And if there is then we should assume that it's a Korean date and then not ignore it. Is that right?

By the way, '월' is often used to denote a non-printable character, so could you please tell me what the character-code of this character actually is?

- Hans (EnterpriseDT)
0 votes
by (240 points)
You're right!
'year-month-day' is denoted like below in Korean. (all characters are 2 bytes.)
- year - 년 - character code (45380)
- month - 월 - character code (50900)
- day - 일 - character code (51068)

Those characters have to be considered in the 'if' condition.
Or be check the specific characters rather than byte of character(1 or 2 byte).

Thanks.
0 votes
by (162k points)
Send us an email to get a link to a DLL with a fix.
0 votes
by (240 points)
Thanks for your support.
I'm using edtFTPj, not edtFTPnet.
and I sent an email.
0 votes
by (162k points)
Patch coming (and also applied to edtFTPnet)

Categories

...