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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:20:12+00:00 2026-06-10T18:20:12+00:00

I am having difficulty outputting data in UTF-8 format. I have a test case

  • 0

I am having difficulty outputting data in UTF-8 format. I have a test case set up where data I am reading from an input file contains a British pound symbol (Hex C2A3). When I write it out on Linux, I get valid UTF-8 (C2A3). On windows, I only get HEX A3.

I tried using a PrintStream and specifying the character set as “UTF-8”. No luck. I tried many other streams with no luck until I finally tried a DataOutputStream. I used the “write()” method which took a byte array as a parameter. I needed to output a string, so I called “myString.getBytes(“UTF-8″)”.

I ended up with code like:

dataOutputStream.write(myString.getBytes(“UTF-8”));

This works properly on both systems; Windows 7 and Linux.

I am trying to understand why this worked and convince myself my solution is correct. Does it come down to system Locale’s? Linux defaults to en_US.utf-8. While all I could specify in Windows was just “en_US”. So when the outputstream attempted to get data from the string, the string was sending its data based upon the locale?

  • 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-06-10T18:20:14+00:00Added an answer on June 10, 2026 at 6:20 pm

    Or are you using FileOutputStream and there it matters the character encoding or DataOutputStream where you write binary. You should do a research too, but look at here please

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

Sidebar

Related Questions

I am having difficulty in printing to a text file from chosen locations within
I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax() To
Having difficulty grabbing data from an XML and putting it into an Array. At
I'm essentially having difficulty pass dynamic variables to a view. I have php functions
Having difficulty making my javascript act the way I want. I have a button,
I'm having difficulty scraping dates from a specific web page because the date is
I'm having difficulty getting my textarea to expand vertically automatically. I have some code
I'm having difficulty with this problem. I have a table with this structure: OrderID
Im having difficulty in understanding how the pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)rowinComponent:(NSInteger)component works Ive set up
I am having difficulty executing a MS SQL Server stored procedure from Java/jsp. I

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.