Jump to content

Japanese Encoding


sniperscope

Recommended Posts

hi gurus.

how can i convert japanese text into %E3%83%96%E3%83%AD%E3%82%B0%E6%A4%9C%E7%B4%A2.

in url looks normal japanese characters but if copy entire url and paste into DW all kanji characters change into above. Is this encoding. Because i am doing something which grab records from google search.

So, if i use

$SearchURL = "http://blogsearch.google.co.jp/blogsearch?hl=ja&ie=UTF-8&q=%E9%A2%A8&btnG=%E3%83%96%E3%83%AD%E3%82%B0%E6%A4%9C%E7%B4%A2&lr=lang_ja";

works exact result what i want. But if use

$SearchURL = "http://blogsearch.google.co.jp/blogsearch?hl=ja&ie=UTF-8&q=JapaneseTEXT&btnG=Japanese_Button_Name&lr=lang_ja";

then result appear totally different thing.

 

any idea how to solve this issue.

 

Regards

 

Link to comment
https://forums.phpfreaks.com/topic/203721-japanese-encoding/
Share on other sites

sorry for second post but i can not edit my own post.

anyway, i would like to transform japanese text into %E3%83...... format. How can i do that ? or what kind of encoding is this?

 

Use rawurlencode to slove this problem.

 

Here : http://php.net/manual/en/function.rawurlencode.php

 

mrqpro

 

Link to comment
https://forums.phpfreaks.com/topic/203721-japanese-encoding/#findComment-1067053
Share on other sites

Dear mrqpro thanks for advice but it doesn't solve my problem.

if you search something in google with japanese characters google shows correct japanese characters in URL. but if you copy and paste that url, kanji karacters transform into %E3%83 format.

ie; let's say i am searching 日本(which means Japan) and google shows

http://www.google.com/#hl=en&source=hp&q=日本&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=dfdf66882bd03aae

in the URL.

bu if you copy and paste that url transform into

http://www.google.com/#hl=en&source=hp&q=%E6%97%A5%E6%9C%AC&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=dfdf66882bd03aae

 

All i want is user input some japanese characters into text area then hit search button, my form search google with cURL. But mentioned problem always shows different result.

So, user input normal japanese character but i want to transform it into  %E6%97%A5%E6%9C%AC type format and then run cURL.

 

Hope i could make myself clear.

 

Regards

Link to comment
https://forums.phpfreaks.com/topic/203721-japanese-encoding/#findComment-1067519
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.