MATLAB Answers

0

Is there an equivalent function in Matlab 2019 to the earlier version's isunicode function?

Asked by Brett Poulin on 12 Jun 2019
Latest activity Answered by Rik
on 12 Jun 2019
Or is there any other way to read a file and delete the unicode characters?

  0 Comments

Sign in to comment.

2 Answers


Answer by Rik
on 12 Jun 2019

The isunicode function may look promissing, but doesn't actually work on my test files (generated with Notepad++). The same problem occurred with Walter's detect_UTF_encoding function (for which I appear to have misplaced the thread it was posted in). Trying to detect the encoding is a tricky business.
But if you want to remove any Unicode chars you can also use my readfile FEX submission. It will try to determine if a file contains UTF8 chars and will handle the conversion. You should be able to use this function to read your file and discard any >128 chars.
Note that if you're using Matlab 6.5 or GNU Octave, some restrictions apply to what files are read succesfully.

  0 Comments

Sign in to comment.