|
| From: | Markus Mützel |
| Subject: | [Octave-bug-tracker] [bug #58368] UTF16 and UTF32 characters in MAT files |
| Date: | Sat, 16 May 2020 12:40:21 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0 |
Update of bug #58368 (project octave):
Status: None => Patch Submitted
_______________________________________________________
Follow-up Comment #3:
Thanks Guillaume for testing.
The attached patch saves character arrays as UTF-8 to .mat files (-v6 and
-v7). With it, a save-load-cycle seems to work fine in Octave.
Also Matlab seems to accept loading .mat files with UTF-8 encoded strings.
(Tested with Matlab R2020a). However, they seem to get the string length wrong
for strings with multi-byte characters. See the trailing 0 for "Réunion" in
Matlab when loading the file saved by Octave:
>> double(A{14})
ans =
82 233 117 110 105 111 110 0
I'd say this is a Matlab bug. But we could work around it by converting our
strings to UTF-16 before writing to the .mat file.
(file #49093)
_______________________________________________________
Additional Item Attachment:
File name: bug58368_utf_mat_v2.patch Size:8 KB
<https://savannah.gnu.org/file/bug58368_utf_mat_v2.patch?file_id=49093>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58368>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |