Permalink
Browse files

allow non lantin characters in filename

  • Loading branch information...
1 parent cdf670f commit 53e52cb5ac65c37a316ca29bff4fd5f85cf0c979 @0x01f7 0x01f7 committed May 30, 2016
@@ -55,7 +55,7 @@ def sanitized_file_name_from(file_name)
file_extension = '.' + parts.pop
end
- parts.join('.').gsub(/[^\w\-\/]+/, '_') + file_extension.to_s
+ parts.join('.').gsub(/[^[:word:]\-\/]+/, '_') + file_extension.to_s
end
end
end
@@ -61,6 +61,9 @@ class Persisters
expected = File.join(FileSystem.storage_location, "a_1/b")
expect(FileSystem.absolute_path_to_file("a 1/b")).to eq(expected)
+
+ expected = File.join(FileSystem.storage_location, "萬國碼")
+ expect(FileSystem.absolute_path_to_file("萬國碼")).to eq(expected)
end
it 'handles files with no extensions (even when there is a dot in the path)' do

0 comments on commit 53e52cb

Please sign in to comment.