Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A,B,C
100,200,300
aaa,bbb,ccc
4 changes: 4 additions & 0 deletions pandas/io/tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,10 @@ def test_utf16_example(self):
result = self.read_table(buf, encoding='utf-16')
self.assertEquals(len(result), 50)

def test_read_csv_example_in_windows_filesystem(self):
path = tm.get_data_path(u'日本語ファイル名テスト_read_csv_in_win_filesystem.csv')
self.read_csv(path)

def test_converters_corner_with_nas(self):
# skip aberration observed on Win64 Python 3.2.2
if hash(np.int64(-1)) != -2:
Expand Down
5 changes: 4 additions & 1 deletion pandas/parser.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ cdef class TextReader:

if isinstance(source, basestring):
if not isinstance(source, bytes):
source = source.encode('utf-8')
if sys.getfilesystemencoding() is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just do:

source = source.encode(sys.getfilesystemencoding() or 'utf-8')

source = source.encode('utf-8')
else:
source = source.encode(sys.getfilesystemencoding())

if self.memory_map:
ptr = new_mmap(source)
Expand Down