From 82acbaaacf50d6ac2db1e810839939a278e96833 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Mon, 11 Apr 2011 09:29:54 +0000 Subject: FTP: Multiple fixes for localized directory listings: - fix detection of KOI8-R and possibly other encodings - fix parsing Russian month names When detecting the listing encoding, we need to not only check whether the data can be converted using given encoding, but also whether the result can be parsed as a valid directory listing. Also, we only need to compare the first three characters of the abbreviated month name, because that's how they're abbreviated in FTP directory listings. Finally, the Russian directory listings have swapped the "month" and "day of month" columns. BUG=65917 Review URL: http://codereview.chromium.org/6718043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81081 0039d316-1c4b-4281-b951-d872f2087c98 --- net/data/ftp/dir-listing-ls-25 | 6 ++++ net/data/ftp/dir-listing-ls-25.expected | 53 +++++++++++++++++++++++++++++++++ net/data/ftp/dir-listing-ls-26 | 6 ++++ net/data/ftp/dir-listing-ls-26.expected | 53 +++++++++++++++++++++++++++++++++ net/data/ftp/dir-listing-ls-27 | 6 ++++ net/data/ftp/dir-listing-ls-27.expected | 53 +++++++++++++++++++++++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 net/data/ftp/dir-listing-ls-25 create mode 100644 net/data/ftp/dir-listing-ls-25.expected create mode 100644 net/data/ftp/dir-listing-ls-26 create mode 100644 net/data/ftp/dir-listing-ls-26.expected create mode 100644 net/data/ftp/dir-listing-ls-27 create mode 100644 net/data/ftp/dir-listing-ls-27.expected (limited to 'net/data') diff --git a/net/data/ftp/dir-listing-ls-25 b/net/data/ftp/dir-listing-ls-25 new file mode 100644 index 0000000..47e0487 --- /dev/null +++ b/net/data/ftp/dir-listing-ls-25 @@ -0,0 +1,6 @@ +drwxr-xr-x 3 ftp ftp 4096 15 апр 18:11 . +drwxr-xr-x 3 ftp ftp 4096 15 июл 18:11 .. +-rw-r--r-- 1 ftp ftp 528 01 май 2007 .message +-rw-r--r-- 1 ftp ftp 528 01 ноя 2007 README +-rw-r--r-- 1 ftp ftp 560 28 сен 2007 index.html +drwxr-xr-x 33 ftp ftp 4096 12 фев 2008 pub diff --git a/net/data/ftp/dir-listing-ls-25.expected b/net/data/ftp/dir-listing-ls-25.expected new file mode 100644 index 0000000..3405f86 --- /dev/null +++ b/net/data/ftp/dir-listing-ls-25.expected @@ -0,0 +1,53 @@ +d +. +-1 +1994 +4 +15 +18 +11 + +d +.. +-1 +1994 +7 +15 +18 +11 + +- +.message +528 +2007 +5 +1 +0 +0 + +- +README +528 +2007 +11 +1 +0 +0 + +- +index.html +560 +2007 +9 +28 +0 +0 + +d +pub +-1 +2008 +2 +12 +0 +0 diff --git a/net/data/ftp/dir-listing-ls-26 b/net/data/ftp/dir-listing-ls-26 new file mode 100644 index 0000000..45d7e8a --- /dev/null +++ b/net/data/ftp/dir-listing-ls-26 @@ -0,0 +1,6 @@ +drwxr-xr-x 3 ftp ftp 4096 15 18:11 . +drwxr-xr-x 3 ftp ftp 4096 15 18:11 .. +-rw-r--r-- 1 ftp ftp 528 01 2007 .message +-rw-r--r-- 1 ftp ftp 528 01 2007 README +-rw-r--r-- 1 ftp ftp 560 28 2007 index.html +drwxr-xr-x 33 ftp ftp 4096 12 2008 pub diff --git a/net/data/ftp/dir-listing-ls-26.expected b/net/data/ftp/dir-listing-ls-26.expected new file mode 100644 index 0000000..3405f86 --- /dev/null +++ b/net/data/ftp/dir-listing-ls-26.expected @@ -0,0 +1,53 @@ +d +. +-1 +1994 +4 +15 +18 +11 + +d +.. +-1 +1994 +7 +15 +18 +11 + +- +.message +528 +2007 +5 +1 +0 +0 + +- +README +528 +2007 +11 +1 +0 +0 + +- +index.html +560 +2007 +9 +28 +0 +0 + +d +pub +-1 +2008 +2 +12 +0 +0 diff --git a/net/data/ftp/dir-listing-ls-27 b/net/data/ftp/dir-listing-ls-27 new file mode 100644 index 0000000..3c0a304 --- /dev/null +++ b/net/data/ftp/dir-listing-ls-27 @@ -0,0 +1,6 @@ +drwxr-xr-x 3 ftp ftp 4096 15 18:11 . +drwxr-xr-x 3 ftp ftp 4096 15 18:11 .. +-rw-r--r-- 1 ftp ftp 528 01 2007 .message +-rw-r--r-- 1 ftp ftp 528 01 2007 README +-rw-r--r-- 1 ftp ftp 560 28 2007 index.html +drwxr-xr-x 33 ftp ftp 4096 12 2008 pub diff --git a/net/data/ftp/dir-listing-ls-27.expected b/net/data/ftp/dir-listing-ls-27.expected new file mode 100644 index 0000000..3405f86 --- /dev/null +++ b/net/data/ftp/dir-listing-ls-27.expected @@ -0,0 +1,53 @@ +d +. +-1 +1994 +4 +15 +18 +11 + +d +.. +-1 +1994 +7 +15 +18 +11 + +- +.message +528 +2007 +5 +1 +0 +0 + +- +README +528 +2007 +11 +1 +0 +0 + +- +index.html +560 +2007 +9 +28 +0 +0 + +d +pub +-1 +2008 +2 +12 +0 +0 -- cgit v1.1