We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Router not match Thai character

Hello All,

I have character problem in routing as I try to match THAI character in router config file but it not working. I define router as below

    $property->add("/{propertytype:(บ้าน|home|condo|apartment)}", array(
        'action'     => 'index'
    ));

It work fine if the address is mysite.com/home but not match when address is mysite.com/บ้าน

I also try to match any character in my language as below

    $property->add("/area/{province:[ก-ฮ0-๙0-9\-]+}", array(
        'action'     => 'index'
    ));

but it also not working so I have to let any word to match the address like /area/{province} to accept THAI language in url however it will accept any special charecter.

Is it possible to use THAI character in url, How do I write regex to match or I have to add any config in the router?

Thank you for any help.



2.1k

you have to url encode it much like thai domain names https://en.wikipedia.org/wiki/ThaiURL



8.5k

Thank you 7thcubic