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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:45:10+00:00 2026-06-16T10:45:10+00:00

I am running an Apache/PHP/MySQL server (xampp) on my local machine under Windows 7.

  • 0

I am running an Apache/PHP/MySQL server (xampp) on my local machine under Windows 7. There I have installed the MediaWiki-Software, together with many extensions. My aim is to download some pages from Wikipedia and show them locally. Everything runs fine, except for one big problem:

The image files in the German Wikipedia contain German Umlaute (ä, ö, ü) in their file names. This cannot be changed, because the articles link to the names with the Umlaute.

When I try to import these images (via the maintenance/importImages.php script), it does not work. I traced the code and figured out why:

When PHP scans the directory for files, it reads the file names as ANSI strings. MediaWiki internally requires that all strings are utf-8. So the Umlaut in the file name is interpreted as part of a (non-existing) unicode character, which breaks the script.

If I manually add a call to utf8_encode() into the script, the name is fine then, and is correctly added to the database. But the file actually written to the “images” directory has a broken name – two special characters instead of the umlaut. The reason is that the PHP script sends utf-8 strings to the filesystem functions (“copy”, …), but the operating system expects ANSI strings there. I could manually add a call to utf8_decode() before each file system call, but there are thousands of them!

In short form again: The OS works in ANSI (this cannot easily be changed for windows) and the MediaWiki software inside the PHP Server works in utf-8 (also cannot be changed). Is there a way to automatically encode/decode file name strings everytime they go into/out of the PHP server?

I was already playing around with mb_internal_encoding() and mb_http_output(), but this did not change anything: MediaWiki uses hard-coded functions which only work on utf-8 strings.

  • 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-16T10:45:12+00:00Added an answer on June 16, 2026 at 10:45 am

    You need to rename all the files on the filesystem before you import them so they match the data that is inside the database.

    Just ensure when the UTF-8 encoded binary sequence of the filename hits the filesystem, the file is found.

    $fileANSI; // you have this
    $fileUTF8 = ut8_encode($fileANSI); // you do this already
    // insert etc, when MW is ready do:
    rename($fileANSI, $fileUTF8);
    

    So you need to rename each file from it’s current name to the binary sequence when hit.

    For your webserver you might need as well to introduce a rewrite-rule to take care of the incomming HTTP requests as the webserver might use some other file-system handling than PHP itself.

    Also check the system configuration of your file-system which codepage is used. That can differ.

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

Sidebar

Related Questions

I have had apache, php, and mysql server 5.5 installed locally and happily running
I have a WAMP (windows (7), apache, mysql, php) stack all setup and running.
I have a Win7 machine running PHP/MySQL/Apache and I have MySQL Administrator, MySQL Manager
Is there a way to set php running under apache to create folders with
We have a custom PHP/MySQL CMS running on Linux/Apache thats rolled out to multiple
I had a server running on a Windows XP machine using Apache2 with PHP
I'm running XAMPP on win7 to test fairly simple sites using PHP/MySQL/AJAX, and have
I have a site running a Linux/Apache/MySQL/PHP stack. I would like to connect to
I am just beginning with Joomla on a linux fedora server (running apache,mysql,php), running
I am running a ubuntu server with apache/php/mysql. I want to use selenium on

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.