How do I determine my MATLAB default character encoding scheme?

31 vues (au cours des 30 derniers jours)
Matthew Simoneau
Matthew Simoneau le 8 Sep 2011
Using unicode2native with a single argument, it defaults to "the MATLAB default character encoding scheme". How do I find out what my default is?

Réponses (4)

Grzegorz Knor
Grzegorz Knor le 8 Sep 2011
Another solution:
feature('DefaultCharacterSet')

Grzegorz Knor
Grzegorz Knor le 8 Sep 2011
Use java class:
import java.nio.charset.Charset
encoding = Charset.defaultCharset()
  2 commentaires
Matthew Simoneau
Matthew Simoneau le 8 Sep 2011
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 le 8 Sep 2011
"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/>

Connectez-vous pour commenter.


Grzegorz Knor
Grzegorz Knor le 8 Sep 2011
get_param(0, 'CharacterEncoding')

Jan
Jan le 8 Sep 2011
Matlab 2009a, WindowsXP:
get(0, 'Language')
% >> 'en_us.windows-1252'
  1 commentaire
Matthew Simoneau
Matthew Simoneau le 8 Sep 2011
On my Windows 7 machine, all this returns is 'en_us'.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by