Decode text with native2unicode
2 ビュー (過去 30 日間)
古いコメントを表示
I have a vector that should be the header names from some data that was obtained via a metrology software program. I believe it corresponds to text values and I'm trying to decode it.
The array is named jnk and is attached.
This attempt gets close, but there are still lots of gibberish characters. Can anyone suggest a better way of doing this? Is there an array of encoding schemes I can loop through until the text displays legibly?
load example.mat
enscheme = 'UTF-16LE';
jnk1 = native2unicode(jnk,enscheme);
disp(jnk1)
2 件のコメント
Walter Roberson
2024 年 11 月 1 日
That's a tough one. I ran through a number of different encodings, but nothing seemed to fit.
採用された回答
埃博拉酱
2024 年 11 月 2 日
編集済み: 埃博拉酱
2024 年 11 月 2 日
I bet this piece of binary can't be plain text encoded. Because there are no encoding methods that take 0 as a valid character, and you have a large string of zeros in your data.
Using UTF16-LE encoding, you can see some valid words, which means that the character component in this data should be UTF16-LE, and the other parts should be binary numeric types.
I write your data to a txt file and open it with VSCode, which also thinks it's a Binray file. If you force it to open with a text editor, VSCode recommends UTF16-LE as well.
2 件のコメント
埃博拉酱
2024 年 11 月 2 日
The meaningful words you decode should be all there is to it. Everything else is binary data.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!