[Project_owners] URL decoding

Eelco van Kuik moz-needlesearch at planet.nl
Mon Feb 9 16:26:37 EST 2004


Hi Erwin,

Thanks for the idea. I thought about that, it didn't work out though.

Here the complete code:

function decode() {
	const c = "@mozilla.org/intl/scriptableunicodeconverter";
	const i = Components.interfaces.nsIScriptableUnicodeConverter;

	var ucConverter = Components.classes[c].getService(i);
	ucConverter.charset="UTF-8";
	

	// This is á ß õ urlencoded with UTF-8
	var str = '%c3%A1+%C3%9F+%C3%B5';
	
	...How do I turn this into unicode.....?

	var newstr	= ucConverter.ConvertFromUnicode(str);
	alert(newstr)
}

Regards,

Eelco van Kuik


> -----Oorspronkelijk bericht-----
> Van: project_owners-bounces at mozdev.org 
> [mailto:project_owners-bounces at mozdev.org] Namens Erwin Wessels
> Verzonden: maandag 9 februari 2004 15:37
> Aan: Mozdev Project Owners List
> Onderwerp: Re: [Project_owners] URL decoding
> 
> 
> Short answer: I don't know if one exists.
> 
> However... since you've found an XPCOM object that does unicode 
> en/decoding, you could turn the url encoded string into a 
> unicode byte 
> sequence and have that component translate it for you, I'd gather.
> 
> -E
> 
> Eelco van Kuik wrote:
> 
> >Hi,
> >
> >Does anybody know how to turn:
> >
> >%C3%A1+%C3%9F+%C3%B5
> >
> >which is encoded with UTF-8 back into:
> >
> >á ß õ
> >
> >...?
> >
> >I found only an XPCOM object that could do unicode en/decoding, but I
> >couldn't find a URL encoding Xpcom object. 
> >
> >Does one exist?
> >
> >Regards,
> >
> >Eelco van Kuik
> >
> >
> >_______________________________________________
> >Project_owners mailing list
> >Project_owners at mozdev.org
> >http://mozdev.org/mailman/listinfo/project_owners
> >  
> >
> 
> -- 
> This is a signature.
> 
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 




More information about the Project_owners mailing list