How do I determine my MATLAB default character encoding scheme?

Using unicode2native with a single argument, it defaults to "the MATLAB default character encoding scheme". How do I find out what my default is?

回答 (4 件)

Grzegorz Knor
Grzegorz Knor 2011 年 9 月 8 日

2 投票

Another solution:
feature('DefaultCharacterSet')
Grzegorz Knor
Grzegorz Knor 2011 年 9 月 8 日

1 投票

Use java class:
import java.nio.charset.Charset
encoding = Charset.defaultCharset()

2 件のコメント

Matthew Simoneau
Matthew Simoneau 2011 年 9 月 8 日
On my box, this returns "windows-1252", which sounds right. Are we sure that MATLAB and Java are always in sync on this?
Grzegorz Knor
Grzegorz Knor 2011 年 9 月 8 日
"MATLAB, unless you specify a particular encoding will use the computer's (user's) default encoding."
<http://blogs.mathworks.com/loren/2006/09/20/working-with-low-level-file-io-and-encodings/>

サインインしてコメントする。

Grzegorz Knor
Grzegorz Knor 2011 年 9 月 8 日

0 投票

get_param(0, 'CharacterEncoding')

1 件のコメント

Matthew Simoneau
Matthew Simoneau 2011 年 9 月 8 日
Thanks, but get_param is a Simulink function.

サインインしてコメントする。

Jan
Jan 2011 年 9 月 8 日

0 投票

Matlab 2009a, WindowsXP:
get(0, 'Language')
% >> 'en_us.windows-1252'

1 件のコメント

Matthew Simoneau
Matthew Simoneau 2011 年 9 月 8 日
On my Windows 7 machine, all this returns is 'en_us'.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeData Type Identification についてさらに検索

製品

質問済み:

2011 年 9 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by