Skip to content

Commit

Permalink
Sample: UTF8 file name
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jan 10, 2025
1 parent 5c94c71 commit bfad82d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/test/t_Sample_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,12 @@
assert aSample.getDescription()[1] == "Tmax (°C)"

os.remove(fname)

# unicode file name
fname = b'Donn\xc3\xa9es'.decode("utf-8")
with open(fname, "w") as f:
f.write("X1;X2;X3;X4\n-1.2;2.3;3.4;-4.5\n5.6;-6.7;7.8;8.9\n-0.1;3.2;5.1;7.5\n")
aSample = ot.Sample.ImportFromCSVFile(fname, ";")
assert aSample.getSize() == 3

os.remove(fname)

0 comments on commit bfad82d

Please sign in to comment.