Mercurial > hg > octave-max
diff src/ls-mat5.cc @ 6954:9dabcb305dda
[project @ 2007-10-04 16:32:37 by jwe]
author | jwe |
---|---|
date | Thu, 04 Oct 2007 16:32:38 +0000 |
parents | 9fddcc586065 |
children | 93c65f2a5668 |
line wrap: on
line diff
--- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -140,6 +140,7 @@ read_doubles (is, data, LS_SHORT, count, swap, flt_fmt); break; + case miUTF16: case miUINT16: read_doubles (is, data, LS_U_SHORT, count, swap, flt_fmt); break; @@ -148,6 +149,7 @@ read_doubles (is, data, LS_INT, count, swap, flt_fmt); break; + case miUTF32: case miUINT32: read_doubles (is, data, LS_U_INT, count, swap, flt_fmt); break; @@ -1251,8 +1253,20 @@ { if (type == miUTF16 || type == miUTF32) { - error ("load: can not read Unicode UTF16 and UTF32 encoded characters"); - goto data_read_error; + bool found_big_char = false; + for (int i = 0; i < n; i++) + { + if (re(i) > 127) { + re(i) = '?'; + found_big_char = true; + } + } + + if (found_big_char) + { + warning ("load: can not read non-ASCII portions of UTF characters."); + warning (" Replacing unreadable characters with '?'."); + } } else if (type == miUTF8) {