function rtf::escapeCharacter in Bibliography Module 6
Same name and namespace in other branches
- 6.2 modules/rtf/rtf_export.inc \rtf::escapeCharacter()
- 7 modules/rtf/rtf_export.inc \rtf::escapeCharacter()
- 7.2 modules/rtf/rtf_export.inc \rtf::escapeCharacter()
1 call to rtf::escapeCharacter()
File
- ./
class_rtf.php, line 285
Class
Code
function escapeCharacter($character) {
$escaped = "";
if (ord($character) >= 0x0 && ord($character) < 0x20) {
$escaped = "\\'" . dechex(ord($character));
}
if (ord($character) >= 0x20 && ord($character) < 0x80 || ord($character) == 0x9 || ord($character) == 0xa) {
$escaped = $character;
}
if (ord($character) >= 0x80 and ord($character) < 0xff) {
$escaped = "\\'" . dechex(ord($character));
}
switch (ord($character)) {
case 0x5c:
case 0x7b:
case 0x7d:
$escaped = "\\" . $character;
break;
}
return $escaped;
}