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: *
30: * @param cDb $db
31: * not used any more!
32: * @param int $lang
33: *
34: * @return string|bool
35: * @throws cInvalidArgumentException
36: */
37: function getEncodingByLanguage($db, $lang) {
38: cDeprecated('This method is deprecated and is not needed any longer');
39: return cRegistry::getEncoding();
40: }
41:
42: /**
43: * Special version of htmlentites for iso-8859-2
44: * Returns transformed string
45: *
46: * @param string $input
47: * @return string
48: */
49: function htmlentities_iso88592($input = '') {
50: $arrEntities_pl = array(
51: 'ê',
52: 'ó',
53: '±',
54: '¶',
55: '³',
56: '¿',
57: '¼',
58: 'æ',
59: 'ñ',
60: 'Ê',
61: 'Ó',
62: '¡',
63: '¦',
64: '£',
65: '¬',
66: '¯',
67: 'Æ',
68: 'Ñ'
69: );
70: $arrEntities = conGetHtmlTranslationTable(HTML_ENTITIES);
71: $arrEntities = array_diff($arrEntities, $arrEntities_pl);
72:
73: return strtr($input, $arrEntities);
74: }
75: