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 6374295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:28:13+00:00 2026-05-25T01:28:13+00:00

I have a multipart format text file. i am going threw the file looking

  • 0

I have a multipart format text file. i am going threw the file looking for start of content and from then on writing the content to another file until i hit end of content.

FileInputStream in = new FileInputStream(getContentPath());

InputStreamReader sr = new InputStreamReader(in, "UTF-8");

BufferedReader buffreader = new BufferedReader(sr);

String lineStr;

while ((lineStr = buffreader.readLine()) != null) {

    if (lineStr == "") {
    FileOutputStream fos = new FileOutputStream("", true);
    OutputStreamWriter writer = new OutputStreamWriter(fos, "UTF-8");

    BufferedWriter fbw = new BufferedWriter(writer);
    fbw.write(lineStr);
    fbw.newLine();
    fbw.flush();
    fbw.close();
    }
}

The problem i am getting is the resulting files encoding is all messed up. The input is utf8.

Original in multipart format

Just image file extracted(funny-pictures-bomb-squad-cat-chooses-the-blue-wire.jpg)

  • 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-25T01:28:13+00:00Added an answer on May 25, 2026 at 1:28 am

    Found problem the input charset was not utf8 it is iso-8859-1 http default.

    Used CharsetDecoder to make sure i read/saved string as iso-8859-1.

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

Sidebar

Related Questions

I have a script set up to send out multipart emails; plain text and
I have a multipage reporting services report, and i would like to start from
I have a multipart form that takes basic user information at the beginning with
I have to write a reliable, totally-ordered multicast system from scratch in Python. I
I currently have a form like this: <% form_for @stem, :html => {:multipart =>
I have a Model Book with a virtual attribute for create a Editor from
I have a wxPython application that sends multipart emails with HTML and embedded images.
I have a controller action that allows a user to download a file with
I have a multipart mail which is processed using async read on sockets. The
I have code in view <% uberform_for :profile, :html => { :multipart => true,

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.