FileManager: Edit UTF-8 files

Version 1.62.0

Bugfix
Finished

The "TEXT" token for the edit textarea previous did not encode multi-byte characters properly. This change allows utf8=yes to be added to the GET request, eg: CMD_FILE_MANAGER?path=/TEST/test.txt&action=edit&load_token=TEXT&utf8=yes such that the file-read will notice if the current byte is >=0x80, peeking 3 more bytes ahead to get the possibly full utf-8 character. This allows DA to sort out the unicode number and properly generate an html decimal encoding. If it ends up not being a multi-byte char, then it rewinds those few bytes and continues encoding this char the old way. The Enhanced skin does not pass this value as it's iso-8859-1. Using the Enhanced skin to show and edit UTF-8 files would likely garble the data. If you need to edit UTF-8 file, either swap Enhanced to use UTF-8 (see below), or use the Evolution skin which is only UTF-8. --- EVO2051 T31739

Interested to try DirectAdmin? Get a 30-day Free Trial!