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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:59:43+00:00 2026-06-01T10:59:43+00:00

i have csv files, java app and database, i read csv file from my

  • 0

i have csv files, java app and database, i read csv file from my java application and
after some operation i insert files, one by one, into the database, but characters like ŠĐŽĆČ aren’t inserted correctly. I set database to utf-8 default collation. I realize, through testing, that when i set files with ANSI encoding everything works just fine(ŠĐŽĆČ are inserted correctly into database) but when encoding is UTF-8 characters aren’t inserted correctly. Problem is that the files , i have to insert into DB, must be encoded in UTF-8.
Can you help me with this problem?

  • 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-01T10:59:44+00:00Added an answer on June 1, 2026 at 10:59 am

    Difficult to be specific without more details, but there are a couple of things which spring to mind:

    1) If I understand you correctly, you are saying that your CSV are in UTF8? Have you verified that assumption is correct? And on a related note, given that you think it is UTF-8, how are you loading that file into Java?

    Note, Java’s file readers use the system’s default character encoding. It’s not necessarily UTF-8, and you can check if you print System.getProperty("file.encoding");.

    I tend not to rely on this and load according to a known encoding as follows:

    FileInputStream fis = new FileInputStream("myfile.txt"); 
    BufferedReader reader = new BufferedReader(new InputStreamReader(fis, "UTF-8"));
    ...
    

    2) Database collation is different to specifying a character set. (Note, it would be handy if you also mentioned your database client). Collation relates to sorting/ordering of text. You generally need to specify the character set. How this is done depends a lot on your database.

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

Sidebar

Related Questions

I have made a java application that stores data from a .csv file to
I'm trying to read CSV files using Java. Some of the files may have
I have to read a bunch of .CSV files with dynamic file names from
I have a Java app which reads CSV files which have been created in
I have Java desktop application that works with CSV files. And i want add
I have a little problem, I am building a database from CSV files using
I have an application server in Java which requires parsing a CSV file. Is
I have a java server app that download CSV file and parse it. The
I have an application that loads data from a .csv file and shows it
Task 1: Read each row from one csv file into one seprate txt file.

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.