ChrisB: urlEncode...

Beitrag lesen

Hi,

Warum codiert urlEncode() "Hamburg - ööö" zu "Hamburg%20-%20%C3%B6%C3%B6%C3%B6" und nicht zu "Hamburg%20-%20%F6%F6%F6", so wie ich es gern hätte!

Was soll urlEncode denn fuer eine JavaScriptfunktion sein? Eine native mit diesem Namen ist mir nicht bekannt.

Meinst du vielleicht encodeURI oder encodeURIComponent?
Fuer beide sagt Mozillas Developer Center:
"Encodes a Uniform Resource Identifier (URI) [component] by replacing each instance of certain characters by one, two, or three escape sequences representing the UTF-8 encoding of the character."

MfG ChrisB

--
„This is the author's opinion, not necessarily that of Starbucks.“