views:

44

answers:

1

so I have my php API (html Get api for Flash builder and C# apps). So if you want to submit data to it you use string like

http://localhost/cms/api.php?method=someMethod&string=Your_String

If there are english letters in it its ok. But what if I need to pass UTF-8 string like this Русское Имя to my api what shall I do?

+1  A: 

Use the rawurlencode() function. It will encode your string byte by byte, but it is not a problem, since UTF-8 is an ASCII aware representation. All code positions below 128 are identical to the ASCII one, all code positions above 127 are represented with byte sequences which are all between 128 and 255, so you will not have problems with it. The input wrapper should decode the parameters into your $_REQUEST array properly.

Notinlist
You should check http://stackoverflow.com/questions/2208934 and other sources for setting up UTF-8 environment properly.
Notinlist