1: <?php
2:
3: /**
4: * This file contains some little function to retrieving current encoding.
5: *
6: * @package Core
7: * @subpackage Backend
8: * @author Holger Librenz
9: * @copyright four for business AG <www.4fb.de>
10: * @license http://www.contenido.org/license/LIZENZ.txt
11: * @link http://www.4fb.de
12: * @link http://www.contenido.org
13: */
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: /**
18: * Returns encoding for language with ID $iLang (global $lang in CONTENIDO
19: * style).
20: * The parameter $db has to be an instance of cDb (global $db in con)
21: * and
22: * $cfg is the equivalent to global $cfg array in CONTENIDO.
23: * If no encoding is found or any parameter is not valid, the function will
24: * return
25: * false, otherwise the encoding as string like it is stored in database.
26: *
27: * @deprecated [2015-05-21]
28: * use cRegistry::getEncoding
29: * @param cDb $db
30: * not used any more!
31: * @param int $lang
32: * @return string|boolean
33: */
34: function getEncodingByLanguage($db, $lang) {
35: cDeprecated('This method is deprecated and is not needed any longer');
36: return cRegistry::getEncoding();
37: }
38:
39: /**
40: * Special version of htmlentites for iso-8859-2
41: * Returns transformed string
42: *
43: * @param string $input
44: * @return string
45: */
46: function htmlentities_iso88592($input = '') {
47: $arrEntities_pl = array(
48: 'ê',
49: 'ó',
50: '±',
51: '¶',
52: '³',
53: '¿',
54: '¼',
55: 'æ',
56: 'ñ',
57: 'Ê',
58: 'Ó',
59: '¡',
60: '¦',
61: '£',
62: '¬',
63: '¯',
64: 'Æ',
65: 'Ñ'
66: );
67: $arrEntities = conGetHtmlTranslationTable(HTML_ENTITIES);
68: $arrEntities = array_diff($arrEntities, $arrEntities_pl);
69:
70: return strtr($input, $arrEntities);
71: }
72: