owncloud/apps — pull request #532 by yececiwk (2013-02-06 14:08:25+00:00)
Title: Update files_texteditor/ajax/loadfile.php

The problem was, that loadfile.php (the file text-editor) did not correctly load Windows ANSI / ISO encoded files.

After much research I found a solution:

You have to specify the possible encodings when calling mb_detect_encoding. Then the detection works. Possibly an error in PHP.

You can list all implemented encodings with mb_list_encodings(). In the above code-change we construct a string suitable for mb_detect_encoding with the implode function.

Believe it or not (better try it): Without the modification, the text-editor does not display Windows-ANSI files correctly, with the modification, it does ;-)

It also recognizes UTF with BOM and without BOM and all other implemented encodings!

With this short commandline PHP code you can test it:.

Best wishes
Stefan Hammes