summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2026-07-13 14:44:41 +0200
committerUrban Müller2026-07-13 14:44:41 +0200
commit6524748e66c87ec899b6e24d02508ddd31265c17 (patch)
tree8fec7a36d7ef159f50842be7c30af0eea0fbf4c8 /it.class
parentb1202bc02df27381c63c36085dd2fb2af028b25f (diff)
downloaditools-6524748e66c87ec899b6e24d02508ddd31265c17.tar.gz
itools-6524748e66c87ec899b6e24d02508ddd31265c17.tar.bz2
itools-6524748e66c87ec899b6e24d02508ddd31265c17.zip
combining chars not well defined after blanks and cause more trouble after word split
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index 6ed5425..067b241 100644
--- a/it.class
+++ b/it.class
@@ -609,8 +609,8 @@ static function any2utf8($value, $errprefix = "")
list($value, $error) = array(preg_replace('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe\xbf]/', " ", $value), "forbidden utf-8 character. input=$value");
$value = preg_replace('/\xc2\xad/', '', $value); # Kill invisible soft hyphens
$value = normalizer_normalize($value, Normalizer::FORM_C);
- if (preg_match('/^\pM/u', $value)) # Remove combining characters (e.g. U+0338 "Combining Long Solidus Overlay") at beginning of string
- list($value, $error) = array(preg_replace('/^\pM+/u', "", $value), "combining character at beginning of string. input=$value");
+ if (preg_match('/(^| )\pM/u', $value)) # Remove combining characters (e.g. U+0338 "Combining Long Solidus Overlay") at start of after blank
+ list($value, $error) = array(preg_replace('/(^| )\pM+/u', '$1', $value), "combining character at beginning of string. input=$value");
if ($error && $errprefix)
it::error(array('title' => "$errprefix: " . trim($error)));
}