Is there a way to detect string/letter not compatible with windows-1252 encoding?
7 ビュー (過去 30 日間)
古いコメントを表示
Hi,
Is there a way to detect string/letter not compatible with windows-1252 encoding And then remove them?
0 件のコメント
回答 (1 件)
Walter Roberson
2022 年 11 月 29 日
Yes. When you unicode2native a character that has no counterpart in the destination character set, then binary 26 is substituted.
S = char(['How now?', 2000:2029, ' brown cow'])
B = unicode2native(S, 'windows-1252')
B(B == 26) = []
Sback = native2unicode(B, 'windows-1252')
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!