Is there a way to detect string/letter not compatible with windows-1252 encoding?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
Is there a way to detect string/letter not compatible with windows-1252 encoding And then remove them?
0 commentaires
Réponses (1)
Walter Roberson
le 29 Nov 2022
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')
1 commentaire
Voir également
Catégories
En savoir plus sur Data Type Conversion 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!