Now when I read a .txt file with swedish words into matlab and then output it, all the swedish words became garbled. How can I make my matlab support swedish? Thanks in advance.
No products are associated with this question.
A little experiment:
>> fileread( 'swedish.txt' ) ans = ï»¿Ã…Ã„Ã–Ã¥Ã¤Ã¶ >>
>> fileread( 'swedish.txt' ) ans = ÅÄÖåäö
Thus, I think you read from a file encoded with UTF-8.
See the documentation on fopen. With the correct setting "any" coding can be decoded.
>> sprintf( '%s\n', 'ÅÄÖåäö' ) ans = ÅÄÖåäö
Play games and win prizes!Learn more