I have built an API in PHP with Zend Framework 1.x For now there was only a webclient connecting to the API but we started developing a C# client. I am experiencing an issue, here is how it works :
- User fills the form in the C# client
- C# sends the data with WebClient.UploadValues (Some values are added such as hmac of the parameteds, x-api-key, etc).
- The server receives the data
- The serveur converts the data to a json and creates the hmac from it
- The server compares the hmac sent and the hmac created
Here is where my problem is. Everything works fine if I send datawithout accents. But if there are, the Zend_Json::encode($params) returns a json encoded in UTF8 so the hmac created is not the same as the one sent.
So, I am wondering (as for some mysterious reason utf8_decode($json) does not work, should I find a way to compare the utf8 decoded json hmac of should I as the C# client to send all the parameters encoded in utf8 ?