diff options
Diffstat (limited to 'library/Director/PropertyModifier/PropertyModifierFromLatin1.php')
-rw-r--r-- | library/Director/PropertyModifier/PropertyModifierFromLatin1.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/library/Director/PropertyModifier/PropertyModifierFromLatin1.php b/library/Director/PropertyModifier/PropertyModifierFromLatin1.php new file mode 100644 index 0000000..272956c --- /dev/null +++ b/library/Director/PropertyModifier/PropertyModifierFromLatin1.php @@ -0,0 +1,23 @@ +<?php + +namespace Icinga\Module\Director\PropertyModifier; + +use Icinga\Module\Director\Hook\PropertyModifierHook; +use function iconv; + +class PropertyModifierFromLatin1 extends PropertyModifierHook +{ + public function getName() + { + return 'Convert a latin1 string to utf8'; + } + + public function transform($value) + { + if ($value === null) { + return null; + } + + return iconv('ISO-8859-15', 'UTF-8', $value); + } +} |