can't change encoding of text file
5 次查看(过去 30 天)
显示 更早的评论
while using the function fopen and textscan for text file i get this warning:
*Warning: The encoding 'windows-1255' is not supported.
See the documentation for FOPEN.
> In txt2mat at 16
> In Inversion at 11*
i googled the problem and found this:
if the problem is in the current encoding type, i can't change it the problem is that i can't change the encoding for example if i add this line to the function: slCharacterEncoding('Windows-1252') matlab won't run any commands.
and this is few of the files that i'm trying to read:
https://dl.dropboxusercontent.com/u/38094905/dielTM_dec4f.exp https://dl.dropboxusercontent.com/u/38094905/rectTE_8f.exp
don't understand this error and what am i doing wrong, but i do get unexpected resaults.
2 个评论
per isakson
2014-12-23
编辑:per isakson
2014-12-23
Please upload the files together with the question. See the paper-clip button. I failed to download the m-file. The new-line characters were lost somewhere on the way.
采纳的回答
per isakson
2014-12-23
编辑:per isakson
2014-12-23
The code runs here (R2013a,Win7) without any problems
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172600/image.png)
 
"Warning: The encoding 'windows-1255' is not supported."   Matlab doesn't support 'windows-1255', (see fopen). Is your computer configured with 'windows-1255'?
Try
fid = fopen( adress, 'r', 'n','windows-1250' );
"slCharacterEncoding"   is a Simulink function. AFAIK: it has nothing to do with textscan
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!