why do i get windows-1255 message?

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?

답변 (1개)

Guillaume
Guillaume 2015년 6월 4일

1 개 추천

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

ben velt
ben velt 2015년 6월 4일
yes the file is read properly. what do you mean by the encoding of the file? the file is a regular .txt file. what does the 'US-ASCII' changes? because after I add it there isnt any error message?
Guillaume
Guillaume 2015년 6월 4일
This page kind of explains the differences between the encodings.
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 &#1492 (windows-1255), whereas in windows-1253 character number 228 is the greek glyph &#0948. In US-ASCII the same character is glyph &#228.
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

질문:

2015년 6월 3일

댓글:

2015년 6월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by