huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

BasicClientHelper.java encoding bug... change "UTF8" to "UTF-8" #297

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have a friend with a weird character in their name such as Téster
2. Use the FacebookJsonRestClient and run fql_query "SELECT uid, first_name
FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = "+
userClient.users_getLoggedInUser() + ")";
3. You will get an exception similar to the following:
ERROR [2010-02-23 10:59:25,233] [TP-Processor8]
[ng.facebookapp.util.AltitudeFacebookHelper]: java.lang.RuntimeException:
org.json.JSONException: Substring bounds error at 2337 [character 2338 line 1]
java.lang.RuntimeException: org.json.JSONException: Substring bounds error
at 2337 [character 2338 line 1]
    at
com.google.code.facebookapi.BasicClientHelper.runtimeException(BasicClientHelper
.java:123)
    at com.google.code.facebookapi.JsonHelper.jsonToJavaValue(JsonHelper.java:78)
    at com.google.code.facebookapi.JsonHelper.parseCallResult(JsonHelper.java:48)
    at
com.google.code.facebookapi.FacebookJsonRestClientBase.parseCallResult(FacebookJ
sonRestClientBase.java:58)
    at
com.google.code.facebookapi.FacebookJsonRestClient.fql_query(FacebookJsonRestCli
ent.java:49)

What version of the product are you using? On what operating system?
3.0.2 on windows and centos5

Please provide any additional information below.

In file BasicClientHelper.java line 68 reads:
result = URLEncoder.encode( result, "UTF8" );

changing to "UTF-8" solves the issue

Original issue reported on code.google.com by karl.s...@gmail.com on 23 Feb 2010 at 10:03

GoogleCodeExporter commented 8 years ago
Looks like I was wrong. I think all you need to do is include a newer JSON jar 
which
from the looks of the SVN repository you're already doing. So I'm pretty sure 
this
can be closed.

Original comment by karl.s...@gmail.com on 2 Mar 2010 at 5:46