Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66B9310ADE for ; Thu, 20 Feb 2014 09:24:30 +0000 (UTC) Received: (qmail 84270 invoked by uid 500); 20 Feb 2014 09:24:26 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 84153 invoked by uid 500); 20 Feb 2014 09:24:24 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 83975 invoked by uid 99); 20 Feb 2014 09:24:22 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 09:24:22 +0000 Date: Thu, 20 Feb 2014 09:24:22 +0000 (UTC) From: "pavan (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NET-516) problem occurs if the filename contains one or more characters of which the second byte of Shift-JIS code is 0x85 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NET-516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906796#comment-13906796 ] pavan commented on NET-516: --------------------------- The issue is happening because of the regular expression used from commons-net-2.0. The regex used by the commons-net 2.0 is (\\S+)\\s+(\\S+)\\s+(?:()|([0-9]+))\\s+(\\S.*). If you carefully look at the last capturing group (\\S.*) first it looks for a non whitespace character then for any character. According the java pattern class documentation 0x85 is a line terminator and also .* by default only matches printable characters and wont match any control characters. Creating the pattern using Pattern.DOTALL makes control characters also to match. I am attaching a sample program for reproducing the issue. > problem occurs if the filename contains one or more characters of which the second byte of Shift-JIS code is 0x85 > ------------------------------------------------------------------------------------------------------------------ > > Key: NET-516 > URL: https://issues.apache.org/jira/browse/NET-516 > Project: Commons Net > Issue Type: Bug > Components: FTP > Affects Versions: 2.0 > Environment: windows > Reporter: Asha K S > Fix For: 2.0 > > Attachments: notworking.png, working.png > > > Problem occurs if the filename contains one or more characters of which the second byte of Shift-JIS code is 0x85, on a windows Japanese machine when listing file names from IIS FTP server. > This was working fine in commons-net-1.4.0.jar . -- This message was sent by Atlassian JIRA (v6.1.5#6160)