You are here

function _filebrowser_encoding_from_fs in Filebrowser 7.2

Same name and namespace in other branches
  1. 8 filebrowser.common.inc \_filebrowser_encoding_from_fs()
  2. 7.4 filebrowser.common.inc \_filebrowser_encoding_from_fs()
  3. 7.3 filebrowser.common.inc \_filebrowser_encoding_from_fs()

Convert a string from FileSystem encoding to UTF-8.

Parameters

$node which provide FileSystem encoding information.:

$source source string:

Return value

re-encoded string

2 calls to _filebrowser_encoding_from_fs()
filebrowser_page_download in ./filebrowser.pages.inc
Callback for filebrowser_download/%node menu.
_filebrowser_load_files in ./filebrowser.common.inc
Load data from current path.

File

./filebrowser.common.inc, line 200
Misc filebrowser common functions.

Code

function _filebrowser_encoding_from_fs(&$node, $source) {
  return strcasecmp($node->folder_presentation->encoding, 'UTF-8') == 0 ? $source : mb_convert_encoding($source, "UTF-8", $node->folder_presentation->encoding);
}