Yii Framework Forum: Chinese chars on URL parameters - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chinese chars on URL parameters How to include chinese characters on URL? Rate Topic: -----

#1 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 02 July 2012 - 07:23 AM

Hi Guys,

I need to solve a small issue I have for a project I am doing now. The project is for an Asian company and we have to include ASIAN characters on URL, like the following: http://www.eztable.c...-07-04&people=2

I am not familiar at all with this, could you help me out? It seems that is simply encoded but when I try to do it, the URL is not converted to Chinese chars (the above URL is displayed as the attached image and thats what my client wants)

Attached File  Screen Shot 2012-07-02 at 2.22.04 PM.png (15.18K)
Number of downloads: 14

Any help would be highly appreciated
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#2 User is offline   kiran sharma 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 493
  • Joined: 21-May 11
  • Location:India

Posted 02 July 2012 - 08:35 AM

Hi,
the url you provide, the website contain all link in chinese and on hover it pass request parameter in chinese as specified in anchor tag, so i don't think they use any encode method.
they provide chinese anchor tag( might directly typed from chinese language keyboard ).
and gr8 to see you here.. :)
Thanks,
Kiran Sharma.
0

#3 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 02 July 2012 - 10:57 AM

View PostKiran Sharma, on 02 July 2012 - 08:35 AM, said:

Hi,
the url you provide, the website contain all link in chinese and on hover it pass request parameter in chinese as specified in anchor tag, so i don't think they use any encode method.
they provide chinese anchor tag( might directly typed from chinese language keyboard ).
and gr8 to see you here.. :)


What do you mean? They do not use any encode and the browser will automatically display the chars? I am not familiar at all to work with asian languages.

PS: 2muchwork.... unable to be as much as i would love to
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#4 User is offline   kiran sharma 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 493
  • Joined: 21-May 11
  • Location:India

Posted 03 July 2012 - 12:34 AM

Hi,
as I also not so much aware with development in Asian language, I had work only with English.
I don't know you want to encode the url or not.

-- But here is demo what I had do to pass chinese char in url and get by Request method.

On redirect I use this code,
..
..
$this->redirect(array('admin','tag_family'=>'餐廳排行榜'));

and on echo the specified request I got the chinese character word as request,
public function actionAdmin()
{
	echo $_REQUEST['tag_family'];

the out put shows : 餐廳排行榜
..
to see example you can also saw Yii forum chinese community posts for idea.

I use Dreamweaver to save file, as when I tried with Eclipse it not save file as chinese characters specified in file.
Thanks,
Kiran Sharma.
1

#5 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 03 July 2012 - 06:49 AM

View PostKiran Sharma, on 03 July 2012 - 12:34 AM, said:

Hi,
as I also not so much aware with development in Asian language, I had work only with English.
I don't know you want to encode the url or not.

-- But here is demo what I had do to pass chinese char in url and get by Request method.

On redirect I use this code,
..
..
$this->redirect(array('admin','tag_family'=>'餐廳排行榜'));

and on echo the specified request I got the chinese character word as request,
public function actionAdmin()
{
	echo $_REQUEST['tag_family'];

the out put shows : 餐廳排行榜
..
to see example you can also saw Yii forum chinese community posts for idea.

I use Dreamweaver to save file, as when I tried with Eclipse it not save file as chinese characters specified in file.


Thank you so much... you were right, in order to display the parameters in Chinese or any other asian language, we do not need to encode it... customer wanted to beautify the URL with its language. I am not using the parameter at all for any operation on my code so I believe I am on the safe line.

Cheers and thanks! +1 for your kindness
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#6 User is offline   kiran sharma 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 493
  • Joined: 21-May 11
  • Location:India

Posted 03 July 2012 - 06:56 AM

Welcome anytime... :rolleyes:
Thanks,
Kiran Sharma.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users