You could also use JavaScripts built in decodeURI, then escape the
spaces with a backslash.
On 5/8/05, Dirk Einecke <email@hidden> wrote:
> Hi,
>
> I'm working on a widget where the user can drag&drop files from the
> finder to the widget. The widget is doing something with this given
> path in widget.system() - but I've a problem with special characters.
> A "ß" in a file name is %C3%9F in the widget and I need a other
> "translation" for widget.system(). Can anybody tell me how do deal
> with this problem? Is there a function to "translate" this?
>
> A little test:
>
> file name on the desktop:
> ü - ö - ä - ß - ! - " - § - $ - % - & - / - ( - ) - = - ? - ´ - `
>
> alert from the widget:
> file://localhost/Users/dirkeinecke/Desktop/u%CC%88%20-%20o%CC%88%20-%
> 20a%CC%88%20-%20%C3%9F%20-%20!%20-%20%22%20-%20%C2%A7%20-%20$%20-%20%
> 25%20-%20&%20-%20:%20-%20(%20-%20)%20-%20=%20-%20%3F%20-%20%C2%B4%20-%
> 20%60/
>
> that what I need for widget.system():
> u\314\210\ -\ o\314\210\ -\ a\314\210\ -\ \303\237\ -\ \!\ -\ \"\ -\
> \302\247\ -\ \$\ -\ %\ -\ \&\ -\ \:\ -\ \(\ -\ \)\ -\ \=\ -\ \?\ -\
> \302\264\ -\ \`
>
> I strip the first part I do not need with this line:
> uri = uri.replace(/file:\/\/localhost/,'');
>
> I "translate" space character with this line:
> uri = uri.replace(/%20/g,'\\ ');
>
> Yes - it is possible to replace all special character - but is this
> the best solution?
>
> greetings
> Dirk Einecke _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Dashboard-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/dashboard-dev/email@hidden
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden
This email sent to email@hidden