HTMLのテーブルを読み取ると、日本語が文字化けしてしまいます。
15 次查看(过去 30 天)
显示 更早的评论
日本語の文字を含むHTMLをreadtableを実行してテーブルを読み取ったとき、日本語が文字化けしてしまうのはなぜですか?
以下のコマンドを実行し読み取りました。
opt = htmlImportOptions('TableSelector',"//TABLE[1]");
table = readtable(url,opt);
0 个评论
采纳的回答
Kojiro Saito
2022-12-1
编辑:Kojiro Saito
2022-12-1
エンコードが合っていないためだと思われます。readtableにweboptionsも引数に入れられるので、日本語の文字コードを指定してみたらどうでしょうか。
webopts = weboptions('CharacterEncoding', 'Shift_JIS');
% webopts = weboptions('CharacterEncoding', 'UTF-8');
table = readtable(url,opt, 'WebOptions', webopts)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!