3 Replies - 3141 Views - Last Post: 13 April 2010 - 06:30 AM Rate Topic: -----

#1 blakpower   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 26
  • Joined: 09-February 09

Having accented characters in url

Posted 13 April 2010 - 03:12 AM

Hi,

I am trying to use accented characters on a URL link on a web browser. the links will be similar to this: http://fr.wikipedia....3%A9n%C3%A9rale

I am not sure what section to put this in but as the site is mostly PHP i added it here.

I was wondering if anyone had an idea or had done this before

Thanks in Advance

This post has been edited by blakpower: 13 April 2010 - 03:31 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Having accented characters in url

#2 e_i_pi   User is offline

  • = -1
  • member icon

Reputation: 879
  • View blog
  • Posts: 1,893
  • Joined: 30-January 09

Re: Having accented characters in url

Posted 13 April 2010 - 05:07 AM

The function you need is urlencode(). An example of it in action can be seen here:
http://sqa.fyicenter...HP_Function.php

echo urlencode("Comptabilité générale");


should output (I say should because I'm at work and don't have access to a PHP server):

Quote

Comptabilit%C3%A9+g%C3%A9n%C3%A9rale


Also, if you want the actual hex values of urlencoded characters, there is a good resource here:
http://www.utoronto..../iso_table.html
It conveniently shows the decimal and entity values also.
Was This Post Helpful? 1
  • +
  • -

#3 mhollis   User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 61
  • Joined: 10-April 10

Re: Having accented characters in url

Posted 13 April 2010 - 05:07 AM

While the design for the WWW does allow for the full Roman alphabet and there are movements to extend the character set to double-byte words for non-Roman characters, there is no such move for URLs.

Thus, if you speak Mandarin, you will be using the limited 256-character Roman alphabet only for URLs.

Just as you cannot use spaces or certain punctuation for URLs, you cannot use accented characters for them. This is a limitation, but there is no nefarious conspiracy in doing so.
Was This Post Helpful? 0
  • +
  • -

#4 blakpower   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 26
  • Joined: 09-February 09

Re: Having accented characters in url

Posted 13 April 2010 - 06:30 AM

View Postmhollis, on 13 April 2010 - 04:07 AM, said:

While the design for the WWW does allow for the full Roman alphabet and there are movements to extend the character set to double-byte words for non-Roman characters, there is no such move for URLs.

Thus, if you speak Mandarin, you will be using the limited 256-character Roman alphabet only for URLs.

Just as you cannot use spaces or certain punctuation for URLs, you cannot use accented characters for them. This is a limitation, but there is no nefarious conspiracy in doing so.


Thanks for the reply. If Wikipedia can have accented characters in their urls and it works it should be possible to do it
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1