#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    410
    Rep Power
    24

    Jakarta POI failed to read double bytes


    I tried to use Jakarta POI 2.5.1 to read an Excel file, which consists of single byte characters (English alphabets) and double byte characters (Chinese characters), cell by cell.

    However, all double byte characters are shown as "?". What should I do? Thanks.
    ------------------------------------------
    Perl Kids Kiss Perl
    Stanley
    ------------------------------------------
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Nov 2004
    Location
    Washington DC
    Posts
    2,755
    Rep Power
    1576

    This
    thread might provide some clues. Assuming the fix in the thread works, and is acceptable, it doesn't look like a POI limitation. You might be able to find some more clues by checking out the POI bug tracker
    Open for extension, closed for modification
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    410
    Rep Power
    24
    Thanks for your link. I submited a bug report and wish any solution available.
    ------------------------------------------
    Perl Kids Kiss Perl
    Stanley
    ------------------------------------------
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    410
    Rep Power
    24
    Finally I solve the problem. The problem is not the bug of POI but encoding issue of JAVA.

    Here is the solution:
    Code:
    new String(cell.getRichStringCellValue().getString().getBytes("Big5"), "8859_1")

    Comments on this post

    • tfecw agrees : Thanks for the update
    ------------------------------------------
    Perl Kids Kiss Perl
    Stanley
    ------------------------------------------

IMN logo majestic logo threadwatch logo seochat tools logo