PHP Classes

Detect file encoding and convert it to UTF-8 without BOM: I am unable to detect file encoding, that needs to be converted

Recommend this page to a friend!
  All requests RSS feed  >  Detect file encoding and convert it t...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Detect file encoding and convert it to UTF-8 without BOM

A request is featured when there is no good recommended package on the site when it is posted. Edit

Picture of Ashok by Ashok - 5 years ago (2019-01-23)

I am unable to detect file encoding, that needs to be converted

This request is clear and relevant.
This request is not clear or is not relevant.

0

I am working on a project where I need to upload csv to databse, but here the problem is the file is encoded in the unknown format, so I am unable to upload the file to the database.

I tried many ways like mb_detect_encoding and tried to convert into UTF-8. but not succeed. Can anyone try to help me to solve this problem?

  • 2 Clarification requests
  • 2. Picture of Ray Paseur by Ray Paseur - 5 years ago (2019-01-31) Reply

    This class (#11059) has not been approved yet, but it should help you.

    https://www.phpclasses.org/package/11059-PHP-Validate-strings-in-UTF-8-encoding.html

    • 1. Picture of Ray Paseur by Ray Paseur - 5 years ago (2019-01-28) Reply

      Hi, Ashok. I can help with this. Please give me a test file, or better yet a link to a set of test files. UTF-8 is self-evident, and BOM is easy to remove. I wrote an article about this a few years ago.

      My email is Ray.Paseur [at] Gmail if you want to send me a link to the test data. If you send me an email, I will send you links to my articles and presentation deck. Best regards, Ray

      Ask clarification

      4 Recommendations

      PHP Common Class Library: Set of classes that provides common functionality

      This recommendation solves the problem.
      This recommendation does not solve the problem.

      0

      Picture of Caleb by Caleb package author package author Reputation 25 - 4 years ago (2019-06-24) Comment

      Check out my "Demojibakefier" class. Could be useful for what you need. :-)


      PHP Convert CSV to UTF-8: Convert a CSV file to have data in UTF-8 encoding

      This recommendation solves the problem.
      This recommendation does not solve the problem.

      0

      Picture of peyman by peyman package author package author Reputation 55 - 5 years ago (2019-02-03) Comment

      hi. I write this class especially for your problem, please check this out and see if it will help your problem


      Query result table display class: Outputs tables with the result of database queries

      This recommendation solves the problem.
      This recommendation does not solve the problem.

      0

      Picture of Agro Biz by Agro Biz Reputation 50 - 5 years ago (2019-02-02) Comment

      010 01, Strážov ,Žilina


      PHP UTF-8 Validation: Validate and repair strings in UTF-8 encoding

      This recommendation solves the problem.
      This recommendation does not solve the problem.

      0

      Picture of Ray Paseur by Ray Paseur package author package author Reputation 100 - 5 years ago (2019-01-31) Comment

      See if this helps. If you use this class and have any difficulty with it, please reach out to me. Best of luck, Ray

      • 1 Comment
      • 1. Picture of Johnny Mast by Johnny Mast - 4 years ago (2019-04-01) Reply

        based on this request im working on a package that can scan xx content (emails / files / websites) and detect nom bom content. Content that could display unsupported chars on any content. Developers will be able to add scanning mechanisms and let the engine detect non bom chars in email / csv / files / db / etc etc .. and those adapters could fix the content. It's meganism will be a bit like flysystem for the filesystem.


      Recommend package
      : 
      :