urlencode with two different falvors?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

urlencode with two different falvors?

Post by pedrotuga »

this is strange.

URL encode codes

Code: Select all

á
as

Code: Select all

%E1
but, on google, wikipedia and others it's being coded as:

Code: Select all

%C3%A1

i want to use this second kind of encoding and i can't :(

can anybody tell me why?
and how can i do it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's UTF-8 encoding.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

feyd wrote:It's UTF-8 encoding.
Ok... so which function should i use instead of urlencode() ?

aparently is still encoding all those chars the old way.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

http://www.php.net/utf8_encode might be of interest
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

thank you mates, problem solved.
Post Reply