使用 RestFB 时出现错误 Unicode



我正在编写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.get("message").asString()

最新更新