We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab153d5 commit 0c1de9fCopy full SHA for 0c1de9f
pandas/io/tests/parser/common.py
@@ -8,6 +8,7 @@
8
import re
9
import sys
10
from datetime import datetime
11
+from io import BytesIO
12
13
import nose
14
import numpy as np
@@ -1583,3 +1584,13 @@ def test_temporary_file(self):
1583
1584
new_file.close()
1585
expected = DataFrame([[0, 0]])
1586
tm.assert_frame_equal(result, expected)
1587
+
1588
+ def test_read_csv_utf_aliases(self):
1589
+ # see gh issue 13549
1590
+ expected = pd.DataFrame({'mb_num': [4.8], 'multibyte': ['test']})
1591
+ for byte in [8, 16]:
1592
+ for fmt in ['utf-{0}', 'utf_{0}', 'UTF-{0}', 'UTF_{0}']:
1593
+ encoding = fmt.format(byte)
1594
+ data = 'mb_num,multibyte\n4.8,test'.encode(encoding)
1595
+ result = self.read_csv(BytesIO(data), encoding=encoding)
1596
+ tm.assert_frame_equal(result, expected)
0 commit comments