Skip to content

Commit 66ce96a

Browse files
committed
BF - encode string data as utf-8 on save, matching specified encoding
1 parent dd9bea3 commit 66ce96a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/gifti/giftiio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ def write(image, filename):
7676
The Gifti file is stored in endian convention of the current machine.
7777
"""
7878
f = open(filename, 'wb')
79-
f.write(image.to_xml())
79+
# Our giftis are always utf-8 encoded - see GiftiImage.to_xml
80+
f.write(image.to_xml().encode('utf-8'))
8081
f.close()

0 commit comments

Comments
 (0)