Opening an URL with escapes

Mikuro

Crotchety UI Nitpicker
I'm trying to write a script to take a snippet of foreign text and open it in Google Translate. This SHOULD be very simple: just escape the text, insert it into the URL, and load it in the browser. There's a problem, though. This is an example of a processed URL:

http://translate.google.com/#auto|en|안녕하세요, 세계!

Copy it into a browser, and everything works fine. However, when I try to open it from a script, it always escapes all special characters. So "#auto|en|" becomes "%23auto%7Cen%7C", which is obviously not what I want, and will not work. It also escapes the existing escapes, to "%EC" becomes "%25EC" (%25 is the code for the % sign). The above url, after processing, becomes this nonsense:
Code:
http://translate.google.com/%23auto%7Cen%7C%25EC%2595%2588%25EB%2585%2595%25ED%2595%2598%25EC%2584%25B8%25EC%259A%2594%252C%2520%25EC%2584%25B8%25EA%25B3%2584%2521%250A
And I can't figure out how to get around this. I've tried this from bash, with the "open " command. I've tried it from Pytho...RL like a word! Always have, always will! :p)
 
Back
Top