google电子表格api for arabic

时间:2012-10-25 13:09:02

标签: google-api google-sheets google-api-java-client google-spreadsheet-api google-api-client

我正在尝试使用google电子表格api阅读电子表格。 一切顺利,但是当我在电子表格中放入俄语或阿拉伯语文本时 我的程序打印?????? ?? ?????这些单元格值的值。 以下是从我的Google帐户中读取电子表格的代码。

        SpreadsheetService service = new SpreadsheetService("MyApp");
        service.setUserCredentials(USERNAME, PASSWORD);

URL feedUri = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full?title-exact=true&title=internationalization_contents");

        // Make a request to the API and get all spreadsheets.
        SpreadsheetFeed feed = service.getFeed(feedUri, SpreadsheetFeed.class);
        List<SpreadsheetEntry> spreadsheets = feed.getEntries();

        SpreadsheetEntry spreadsheet = spreadsheets.get(0);

        // get the first work sheet
        WorksheetEntry workSheet = spreadsheet.getWorksheets().get(0);
        URL cellFeedUrl = workSheet.getCellFeedUrl();
        CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class);

        List<CellEntry> entries = cellFeed.getEntries();
        for (int n = 0; n < entries.size(); n++) {
            Cell cell = entries.get(n).getCell();
            System.out.println(cell.getValue());
        }

打印类似

的内容

标题 欢迎 ???? ?? ????

任何人都知道如何正确地将字符添加到我的java应用程序中。

0 个答案:

没有答案