Changing default encoding of MATLAB

조회 수: 93 (최근 30일)
Dominika Mietek
Dominika Mietek 2023년 9월 29일
댓글: Dominika Mietek 2023년 9월 29일
Recently I changed version of matlab from 2020b to 2023b. I cannot change default encoding from UTF-8 to Windows-1252. All of language system settings are correct.
I tried using feature('DefaultCharacterSet', 'windows-1252') but it doesn't work.
Different encoding results in displaying imported data incorrectly. I've imported data from Oracle database. In previous version of matlab with default encoding windows-1252 there was no such problem.
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 9월 29일
As you are importing data, try this alternative -
% read in the file
fID = fopen(filename, 'r', 'n', 'windows-1252');
data = fread(fID);
fclose(fID);
Dominika Mietek
Dominika Mietek 2023년 9월 29일
I don't import data from the file.
I need to change default encoding.

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

채택된 답변

Bruno Luong
Bruno Luong 2023년 9월 29일
I see someone succeed in older MATLAB by editing the file
[matlabroot '\bin\lcdata.xml']
  댓글 수: 1
Dominika Mietek
Dominika Mietek 2023년 9월 29일
I've added to the file and it works fine:
<codeset>
<encoding name="windows-1252">
<encoding_alias name="UTF-8" />
</encoding>

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by