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