0

私の問題は、私が「ヴュルツブルク」(ドイツ)に住んでいるということですが、私のスクリプトは「ヴュルツブルク」と言っています。「¸」を「ü」にするにはどうすればよいですか?

--Get the IP
set webadress to do shell script "curl http://bot.whatismyipaddress.com/"
set tURL to "http://whatismyipaddress.com/ip/" & webadress

--Get the location
set TID to AppleScript's text item delimiters
set webadress to do shell script "curl " & tURL
set AppleScript's text item delimiters to ¬
    "<tr><th>City:</th><td>"
set text1 to text item 2 of webadress
set AppleScript's text item delimiters to "</td></tr>"
set location to text item 1 of text1
4

1 に答える 1

0

ウェブサイトでは ISO-8859-1 を使用していますが、 でエンコーディングを変更できますiconv -f iso-8859-1 -t utf8

do shell script "curl http://whatismyipaddress.com/ip/$(curl http://bot.whatismyipaddress.com/) | iconv -f iso-8859-1 -t utf8 | sed -En 's|<tr><th>City:</th><td>(.*)</td></tr>|\\1|p'"

于 2012-12-16T00:04:39.263 に答える