urlread / urlwrite with umlaut in the url - is there a way to get this to work?

Dear all,
I am trying to read a url that contains german umlauts. This does, apparently, not work with urlread/urlwrite. An example:
urlread('http://www.möbel.de')
produces an error, whereas:
urlread('http://www.moebel.de')
works. Both urls link to the same webpage in this example, btw.
Is there a way to get this to work? In my case, I can not just replace the umlaut (ä -> ae, ö -> oe, ü -> ue), since then the url can not be resolved.
Thanks!
Bjoern

 採用された回答

Friedrich
Friedrich 2014 年 4 月 23 日
HI,
you need to punnycode the name. Try
urlread(char(java.net.IDN.toASCII('http://www.möbel.de')))

1 件のコメント

Jan
Jan 2014 年 4 月 23 日
編集済み: Jan 2014 年 4 月 23 日
Wow. Puny-Code is really unexpected for me:
http://www.xn--mbel-5qa.de
Does this mean, that I cannot reserve this neat address, because someone else wanted to include an ö in his web-address? ;-)
Thanks, Friedrich, for this useful information. +1

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

その他の回答 (0 件)

カテゴリ

質問済み:

2014 年 4 月 23 日

編集済み:

Jan
2014 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by