(self)
| 555 | encoding='UTF-8') |
| 556 | |
| 557 | def test_unicode_roundtrip(self): |
| 558 | utf8 = b'\xcf\x96'.decode('UTF-8') |
| 559 | a = np.array([utf8], dtype=np.str_) |
| 560 | # our gz wrapper support encoding |
| 561 | suffixes = ['', '.gz'] |
| 562 | if HAS_BZ2: |
| 563 | suffixes.append('.bz2') |
| 564 | if HAS_LZMA: |
| 565 | suffixes.extend(['.xz', '.lzma']) |
| 566 | with tempdir() as tmpdir: |
| 567 | for suffix in suffixes: |
| 568 | np.savetxt(os.path.join(tmpdir, 'test.csv' + suffix), a, |
| 569 | fmt=['%s'], encoding='UTF-16-LE') |
| 570 | b = np.loadtxt(os.path.join(tmpdir, 'test.csv' + suffix), |
| 571 | encoding='UTF-16-LE', dtype=np.str_) |
| 572 | assert_array_equal(a, b) |
| 573 | |
| 574 | def test_unicode_bytestream(self): |
| 575 | utf8 = b'\xcf\x96'.decode('UTF-8') |
nothing calls this directly
no test coverage detected