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

1 view (last 30 days)
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

Accepted Answer

Sean de Wolski
Sean de Wolski on 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 Comment
Walter Roberson
Walter Roberson on 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.

Sign in to comment.

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!