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!