You are here

function _filebrowser_encoding_to_fs in Filebrowser 7.2

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

Convert a string from UTF-8 to FileSystem encoding.

Parameters

$node which provide FileSystem encoding information.:

$source source string:

Return value

re-encoded string

7 calls to _filebrowser_encoding_to_fs()
filebrowser_form_create_folder_submit in ./filebrowser.module
create folder submition.
filebrowser_form_create_folder_validate in ./filebrowser.module
Implements hook_validate() for creating a folder
filebrowser_form_delete_confirm_submit in ./filebrowser.module
File delete confirmation form submit
filebrowser_page_download in ./filebrowser.pages.inc
Callback for filebrowser_download/%node menu.
filebrowser_validate in ./filebrowser.module
Implements hook_validate().

... See full list

File

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

Code

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