gpt4 book ai didi

java - 使用 RestFB 时出现 Unicode 错误

转载 作者:太空宇宙 更新时间:2023-11-04 10:40:09 25 4
gpt4 key购买 nike

我正在编写 java spring + Restfb 代码,但我遇到了 unicode 值的问题

我的代码:

@SuppressWarnings({ "deprecation" })
FacebookClient fbClient = new DefaultFacebookClient(ACCESS_TOKEN);
Connection<JsonObject> results =
fbClient.fetchConnection("1173636692750000/feed", JsonObject.class,
Parameter.with("fields", "full_picture,message"),
Parameter.with("limit", "5"));
List<Data> list = new ArrayList<>();
for (JsonObject photo : results.getData()) {
try {
String photoUrl = photo.getString("full_picture");
String message = photo.getString("message");
list.add(new Data(photoUrl, message));
System.out.println(message);
} catch (Exception e) {
System.out.println(".....");
continue;
}
}

输出:

Hàng ba má thanh lý g?p?
Ai l??t bài ch?m em add ??
70kg ch?c em b? nh?t gr luôn roy ?
Ig : Ltasarah_1106
N?u em là thu?c phi?n, anh s? nghi?n hay cai??
Cmt ?i em addfr nah?!
Bây gi? tui có 2 cái l?ng nh? này th? các ông ch?n l?ng nào...
Ig: Zynnienguyen2704
Group có ai là Song Ng? sinh tháng 3 hông ?aaa ??

我的问题:如何修复此错误?

最佳答案

您可以尝试调用String message = photo.getmessage").toString()

关于java - 使用 RestFB 时出现 Unicode 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49081434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com