Filter löschen
Filter löschen

why do i get windows-1255 message?

1 Ansicht (letzte 30 Tage)
ben velt
ben velt am 3 Jun. 2015
Kommentiert: Guillaume am 4 Jun. 2015
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?

Antworten (1)

Guillaume
Guillaume am 4 Jun. 2015
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 Kommentare
ben velt
ben velt am 4 Jun. 2015
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 am 4 Jun. 2015
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by