マトラボでwebの情報を読み込んで、「text = '\u30de\u30c8\u30e9\u30dc'」このようなエンコードされたテキスト入力を、日本語で「text = 'マトラボ'」のような関数に読める形に変換する方法を教えてください。

5 件のコメント

Isabella Osetinsky-Tzidaki
Isabella Osetinsky-Tzidaki 2016 年 12 月 13 日
編集済み: Isabella Osetinsky-Tzidaki 2016 年 12 月 13 日
Please write your request in English, so we Matlab users having no command in Japanese could help you. Thank you!
KSSV
KSSV 2016 年 12 月 13 日
Rough translation:
"Text = '\ u30de \ u30c8 \ u30e9 \ u30dc'" by loading web information in Matrabo "A form that can read such encoded text input into a function like" text = 'Matrabo' "in Japanese Please tell me how to convert to.
Jiro Doke
Jiro Doke 2016 年 12 月 13 日
@Isabella.
Thanks for pointing this out. Yes, while questions in English will result in much more people responding, we do have a bunch of Japanese MathWorks employees monitoring this site as well.
Ma-chi-za-wa
Ma-chi-za-wa 2016 年 12 月 13 日
I apologise for writing questions in Japanese (I was not aware this board is world-wide)... I wanted to decode web-scripted texts imported in to Matlab (i.e., text = '\u30de\u30c8\u30e9\u30dc') in Japanese (or any other languages), so that the output is meaningful in the given language (i.e., text = 'Matlab (in Japanese)'). JiRo Doke neatly answered my question. Simply replacing \u to \x (by strrep function) and extract it (with sprintf function) does the trick. See Jiro Doke's accepted answer for an example. Thank you for your comments.
Jiro Doke
Jiro Doke 2016 年 12 月 13 日
@Machizawa-san
日本語での質問、全然問題ありません。もし、なかなか回答が無い場合は英語で聞いて頂いてもよいと思いますが。引き続き活用ください。
Accept ありがとうございます!

サインインしてコメントする。

 採用された回答

Jiro Doke
Jiro Doke 2016 年 12 月 13 日
編集済み: Jiro Doke 2016 年 12 月 13 日

4 投票

少し分かりづらいんですが、 sprintf で特殊文字を表示する書式を使えば変換できます。それにはまず ¥u ¥x に置き換える必要があります。
>> txt = '\u30de\u30c8\u30e9\u30dc';
>> decodedtxt = sprintf(strrep(txt, '\u', '\x'))
decodedtxt =
マトラボ

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLanguage Support についてさらに検索

製品

質問済み:

2016 年 12 月 13 日

コメント済み:

2016 年 12 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by