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

  • Home
  • SEARCH
  • 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 7091681
In Process

The Archive Base Latest Questions

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

I have been making a program that creates multiple CSV’s from another source CSV

  • 0

I have been making a program that creates multiple CSV’s from another source CSV (encoded in ‘SJIS’/SHIFT-JIS). Here’s the process in which I am creating them:

  1. Create a string, which will hold the contents of the output CSV’s
  2. Fill in said strings with their proper information
  3. Encode the string to UTF-8 from SJIS using mb_convert_encoding()
    code:
    $contents2 = mb_convert_encoding($contents, “UTF-8”, “SJIS”);
  4. Create a zip archive using PHP’s provided library methods and append the files I desire with their corresponding strings using addFromString()
    code:
    $zipFileName = “output.zip”;

        $zip = new ZipArchive;
        if ($zip->open($zipFileName, ZipArchive::CREATE) === TRUE){
            $zip->addFromString('customer.csv', $contents2);
            ...do for the other files
            $zip->close();
        }
        else{
            echo 'Failed! File not created!';
        }
    
  5. Prompt the user with a dialogue box to save the file in their desired location.
    code:
    $zipContents = file_get_contents($zipFileName);
    header(‘Content-Type: application/zip’);
    header(“Content-Disposition: attachment; filename=inflow.zip”);
    header(“Pragma: no-cache”);
    header(“Expires: 0”);
    echo $zipContents;

Now here is my problem: The files that I have created from the zip file are encoded in “UTF-8 without BOM” when I open it in Notepad++. However, I require for these files to just be in plain “UTF-8”. A inventory program I am using to upload these files, for reasons beyond me, will not show the proper characters for the CSV’s encoded in “UTF-8 without BOM”. Once I manually: open the files, re-encode it as “UTF-8”, and save them, are the files able to display the correct characters in this inventory program.

I have read a good deal of articles talking about the converse of this problem, where people were seeking to make their UTF-8 files become encoded without BOM. However, my situation is the exact opposite of this. If there’s an easy solution in PHP I would more than welcome the help! Thanks for reading!!

  • 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-28T08:13:01+00:00Added an answer on May 28, 2026 at 8:13 am

    Found a possible solution, see this: How can I output a UTF-8 CSV in PHP that Excel will read properly?

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

Sidebar

Related Questions

I am making a game that needs a crosshair. I have been playing with
Have been looking at the MVC storefront and see that IQueryable is returned from
I don't know what I have been done. I am making a program. If
I have been tasked with making an existing Java program available via a web
Good afternoon. I have been making a small openGL based app for android that
I have been making a little toy web application in C# along the lines
I have been making a threaded comment system as a way to learn php
I'm relatively new to java (specifically swing) and have recently been making some fairly
I have been using the Rails console a fair bit lately and its making
I have a desktop app that I'm making and I want users to have

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.