why do i get windows-1255 message?
3 次查看(过去 30 天)
显示 更早的评论
I keep getting this message: "Warning: The encoding 'windows-1255' is not supported. See the documentation for FOPEN. > In programtry (line 3) "
this is the program:
clc,clear
fileID = fopen('List.txt','r');
dataTABLE = textscan(fileID, '%f%s%s%f%f%f%[^\n\r]', 'Delimiter', ' ', 'MultipleDelimsAsOne', true, 'HeaderLines' ,0, 'ReturnOnError', false);
fclose(fileID);
does anyone what is the problem?
0 个评论
回答(1 个)
Guillaume
2015-6-4
Your system locale must be hebrew (Windows-1255), so fopen uses that by default.
The question is: what is the encoding of the file? If it just contains plain ASCII characters, then
fileID = fopen('List.txt', 'r', 'n', 'US-ASCII');
would solve the problem.
If the file does contain some Windows-1255 characters, then the question is: is the file read properly despite the warning?
2 个评论
Guillaume
2015-6-4
Basically, standard text files (non-unicode) use single-byte characters. That only gives 256 characters which is not enough to represent the characters of every language. Therefore each locale uses its own codepage to define a set of glyph that correspond to character value. For example in Windows-1255 code page, character number 228 will be the hebrew glyph ה (windows-1255), whereas in windows-1253 character number 228 is the greek glyph δ. In US-ASCII the same character is glyph ä.
All code pages share the same glyphs for characters 0 to 127, so if your text file only contain these characters then the code page does not matter and use whichever you want. If the text file contains character values above 127, then these characters will look wrong if you use the wrong codepage.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!