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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:23:24+00:00 2026-05-21T04:23:24+00:00

I have a scenario where CSV files are being used to maintain data (products)

  • 0

I have a scenario where CSV files are being used to maintain data (products) in a MySQL database. Basically the steps that the client follows to maintain products is as follows:

  • Adds items to the CSV file in predefined columns
  • Uploads the CSV in backend
  • PHP script iterates over CSV data
  • Data is validated / cleaned and sent to MySQL database

Same applies in reverse when the client edits, adds or removes items, however this can also be done straight from the backend. I have had issues with certain characters not showing properly in the database or in the downloaded spreadsheet, so my question is:

Generally, what is a good set of encoding or string functions to apply to the data when adding and retrieving it in the form of a CSV file? My MySQL connection encoding is UTF-8, however I have tried saving the CSV file with a UTF-8 character set, but it seems Excel automatically applies the default Windows-1252 encoding to it, breaking all ym UTF-8 characters.

Applications like Open Office.org prompt you for the import character set, and whe set to Unicode UTF-8 it displays fine. Obviously one cannot rely on the client always using Excel or Open Office, so what is a good solution for PC / CSV > MySQL > back to PC / CSV work?

All suggestions welcomed and appreciated.

Simon

  • 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-21T04:23:24+00:00Added an answer on May 21, 2026 at 4:23 am

    So to answer after the comments. Have a good understanding of http://www.joelonsoftware.com/articles/Unicode.html and look at implementing a datamapper pattern, example article about it here – http://www.devshed.com/c/a/PHP/Implementing-the-Data-Mapper-Design-Pattern-in-PHP-5.

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

Sidebar

Related Questions

I have a scenario where data needs to be imported from a CSV file
So the scenario is this: I have a mySQL database on a local server
I have many different csv files that I would like to convert in to
I have a scenario where data is read from a database and written to
Scenario: I load some data into a local MySQL database each day, about 2
Scenario: over 1.5GB of text and csv files that I need to process mathematically.
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario that requires me to generate a printed page with encrypted
After having the unpleasant surprise that Comma Seperated Value (CSV) files are not necessarily
My scenario is as follows: I have a table of data (handful of fields,

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.