3
4

1 に答える 1

6

The following is an assumption because your question does not document technically so far what the actual cause is.

However what can be said is that you have a character encoding related issue here.

Save your INI file with the UTF-8 encoding and this should work. I assume your PHP script outputs UTF-8 to the browser and the values in the INI file are not UTF-8 encoded. If you save the INI file with UTF-8 encoding, this should then work.

The key point here is not so much the "UTF-8" but that you save the INI file with the right character encoding that is expected from the application you use. For example if your application uses ISO-8859-1, then save the INI file with the ISO-8859-1 encoding.

Both - the INI file and the PHP script - need to speak the same "language".

You can add a "translator" that is able to help you bring two different "languages" together. Such a translator (or more correctly re-encoder) is iconv:

$ini_iso88591 = file_get_contents("sad - Kopie (6)/folder.ini");
$ini_utf8     = iconv("ISO-8859-1", "UTF-8", $ini_iso88591);
$ini_array    = parse_ini_string($ini_utf8, TRUE);
于 2012-10-29T15:50:50.167 に答える