Convert char to number behaves different in command window and m script file

1 vue (au cours des 30 derniers jours)
A =[ 266 316 316 365 366 375 377 362 365 341 345 354 360 345 353 340 350 354 366 405 420 420 478 479 450 440 416 405 385 430 415 393 382 353 345 348 343 314 310 350 348 337 336 330 297];
bString = char(A)
bStringCopy = 'ĊļļŭŮŷŹŪŭŕřŢŨřšŔŞŢŮƕƤƤǞǟǂƸƠƕƁƮƟƉžšřŜŗĺĶŞŜőŐŊĩ'
disp(isequal(bString,bStringCopy))
disp(isequal(double(bString),double(bStringCopy)))
If I copy to command window,the result is :
bString =
ĊļļŭŮŷŹŪŭŕřŢŨřšŔŞŢŮƕƤƤǞǟǂƸƠƕƁƮƟƉžšřŜŗĺĶŞŜőŐŊĩ
bStringCopy =
ĊļļŭŮŷŹŪŭŕřŢŨřšŔŞŢŮƕƤƤǞǟǂƸƠƕƁƮƟƉžšřŜŗĺĶŞŜőŐŊĩ
1
1
However, if I save the code into script and run, then result is different.The script looks exactly the same, but result is different. It's really weired.
codebString =
ĊļļŭŮŷŹŪŭŕřŢŨřšŔŞŢŮƕƤƤǞǟǂƸƠƕƁƮƟƉžšřŜŗĺĶŞŜőŐŊĩ
bStringCopy =
?????????????????????????????????????????????
0
0
  1 commentaire
raym
raym le 4 Jan 2018
For normal char on keyboard, this is not a problem, but for peculiar char, the problem appeared.

Connectez-vous pour commenter.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 4 Jan 2018
This also works in the live editor which supports more unicode. The classic editor does not support it and thus truncates the values apparently.
  1 commentaire
Walter Roberson
Walter Roberson le 4 Jan 2018
The classic editor supports it if UTF-8 files are enabled. Those are automatically in effect for people using the Japanese, Korean, or Chinese interfaces, but can be tricky to enable otherwise.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Language Support dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by