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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:02:35+00:00 2026-05-26T04:02:35+00:00

I am working on an existing php site, and it has an export page

  • 0

I am working on an existing php site, and it has an export page which spits out data and is saved into text documents. (txt & xtg)

$output = ob_get_clean();

The problem I’m trying to fix is the encoding of the output, apparently the charcters are not displaying correctly. I’m pretty sure the database is in the correct UTF-8 format.

The issues show up like this La Fédération

I tried the following, but it didn’t work – the output is still wrong – any ideas ?

$output = mb_convert_encoding($output, "UTF-8");

this is the rest of the relevant code

// Ouput file.
// Set DOS line endings for Quark 6
file_put_contents( "/var/www/vhosts/artsdb.net/httpdocs/export/" . $type . "/" . $filename . ".xtg.txt", str_replace( array( "\n", "\r\n\r\n" ), array( "\r\n", "\r\n" ), $output ) );

echo "Exporting " . str_replace( "_", " ", $filename ) . " ($type) complete.\n\n";

Thanks for looking

  • 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-26T04:02:35+00:00Added an answer on May 26, 2026 at 4:02 am

    I am assuming the data displays properly on the site itself and the browser shows your pages are UTF-8.

    To troubleshoot this, I would first remove any encoding conversion and try to open the text file in a web browser to eliminate any issues with how you’re looking at the file and to confirm it is indeed coming out in UTF-8.

    If the browser above shows the content in the text file is not utf-8, try calling utf8_encode on the $output before writing it to file.

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

Sidebar

Related Questions

I'm working with an existing XML document which has a structure (in part) like
I have been working with an existing website out company has running until I
I'm working with some existing PHP/MySQL code. I'm logging/tracking certain activities into a MySQL
I am working with a pre-existing zen-cart site has been worked on over the
Currently, I am working on restructuring an existing code base. I'm new to php
I am working on an existing ASP.NET MVC app that started small and has
I have a PHP site with a mySQL database that I'm working on. I'm
While working on an existing Drupal site I've noticed a strange glitch that causes
I am working on a drupal site that has a form submit ajax call
I am working with an existing architecture which populates fields on a form with

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.