Character encoding


As PHP 5 does not have support for Unicode filenames, Web File Share can handle filenames that use one particular encoding. By default, Web File Share is configured to convert the text to UTF-8. This allows the users to upload files with names in any language, containing any non-English character. The filenames will look properly in the browser and the user will be able o manage them. The down-side is that, on some operating systems such as MS Windows, when using FTP or other methods of accessing the files directly in the filesystem, the names might not look as expected. For example, if the user uploads with Web File Share a file named "Iñtërnâtiônàlizætiøn.zip", when accessing the folder by FTP, the file's name will look something like this "IñtërnâtiônÃlizætiøn.zip".

Zip archives


As Web File Share will not alter in any ways the contents of the uploaded files, the filenames inside Zip archives will preserve their natural character encoding. To be able to handle these filenames correctly, Web File Share needs to identify the character set and convert it to UTF-8. In order to achieve this you will need to provide some hints on the probable used encoding. You can define a list of encodings inside the "/path-to-Web File Share/customizables/config.php" configuration file, like this:

$config['app']['encoding']['detect'] = "ASCII, UTF-8, BIG-5, EUC-CN"; //this is an example that should help detect Chinese encodings

You can find here "http://www.php.net/manual/en/function.mb-list-encodings.php" the list of encodings that PHP can currently detect.

Note: Most modern programs are using the latest Zip formats and encode the filenames using UTF-8, so there should be no need for any configuration on Web File Share' side.

 



Article ID: 587
Created On: Wed, Mar 5, 2014 at 4:26 AM
Last Updated On: Fri, Nov 17, 2017 at 2:11 PM
Authored by: KB Admin01 [[email protected]]

Online URL: https://kb.quikbox.com/article.php?id=587