Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 365271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:31:16+00:00 2026-05-12T13:31:16+00:00

This is all mixed up in my head, and I can’t wrap my head

  • 0

This is all mixed up in my head, and I can’t wrap my head around it.

I have an excel file I have to parse, using Java, and translate to XML. Using the jExcel library, I can achieve the parsing, and the application’s doing the right work, and putting the right strings in the right place. So for the parsing part, I’ve got that covered.

Problem comes in when I try to transcode the file to UTF-8.

I assumed that the encoding for the excel file was ISO-8859-1, but I’m not exactly sure if it is. Then, I use this function before adding my string to the xml file.

private static String isoToUtf(String thingie){
        byte[] bytedata = thingie.getBytes() ; // Comes in ISO form, as the character set in the DB is set to ISO

        Charset iso = Charset.forName("ISO-8859-1");
        CharsetDecoder isodecoder = iso.newDecoder();
        ByteBuffer bbuf = ByteBuffer.wrap(bytedata);
        CharBuffer cbuf = isodecoder.decode(bbuf);  // Decode from ISO to UTF-16


        Charset utf8 = Charset.forName("UTF-8");
        CharsetEncoder utf8encoder = utf8.newEncoder();
        ByteBuffer outbuffer = utf8encoder.encode(cbuf);  // Encode from UTF-16 to UTF-8
        return new String(outbuffer.array(), "UTF-8");
    }

Somehow, though, it doesn’t work. I still lose some characters to corruption.

Also: I absolutely have to do it this way, it has to be displayed on the intertubes eventually.

The excel file is opened using the java.io.File class.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:31:16+00:00Added an answer on May 12, 2026 at 1:31 pm

    To anyone in the same situation as I, it is possible to specify options for the Workbook you will create with the jExcel library.

    The following link is where I found my answers.

    http://jexcelapi.sourceforge.net/resources/javadocs/2_6_10/docs/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been struggling with this all day. I have an html table in
I have a feeling I'm going about this all wrong. But anyway. I have
I have designed this server to broadcast to all clients when it has to
In my programmer's experience, I have mixed error handling all the ways possible... I
I have been banging my head on the desk for several days over this
So i have this code that works perfectly without the 'file attachment' and sends
I have a Win2003 Server running a number of different ASP.NET websites, all using
I have a problem that I just cannot seem to get my head around,
I have been stuck on this all afternoon, and even tried the following search:
This all worked fine in rails 2.3.5, but when a contractor firm upgraded directly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.