[wp-hackers] Unicode url rewriting using add_rewrite_rule()

Otto otto at ottodestruct.com
Wed Dec 12 18:41:06 UTC 2012


On Wed, Dec 12, 2012 at 12:37 PM, Otto <otto at ottodestruct.com> wrote:
> On Wed, Dec 12, 2012 at 11:36 AM, Deepak Mittal <dpac.mittal2 at gmail.com> wrote:
>> However, this still doesn't work with unicode characters as I need to pass
>> a regular expression modifier 'u' with it. Any idea how I can do that?
>
> Sure. You can't. The regular expression used for rewrite rules doesn't
> contain the u modifier, and there is no option to add it.
>
> See class-wp.php, around line 205-ish.


BTW, unicode characters are not valid in URLs anyway. According to the
RFC (1738), only ASCII characters are allowed in URLs. Anything else
must be percent encoded.

See http://www.faqs.org/rfcs/rfc1738.html

Or a better explanation here:
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

-Otto


More information about the wp-hackers mailing list