Better HN
topnewbestaskshowjobs
Log inSign up

nickpatch

1 karma · joined Mar 13, 2013 (13y ago) · 1 submissions

Polyglot hacker and open source developer specializing in Unicode, i18n, L10n, and natural language processing.
Submissions

comment 13y ago · link · parent

It corrupts Unicode data because it splits on code points instead of grapheme clusters. When performed on 'Spin̈al Tap', it splits the base character U+006E (LATIN SMALL LETTER N) from the combining character U+0308 (COMBINING DIAERESIS) and results in the string 'Spin<span class="s_char">̈</span>al Tap', which contains the valid Unicode grapheme cluster '>̈'! If you were to split on grapheme clusters instead, the result would be 'Spi<span class="s_char">n̈</span>al Tap'. However, I still wouldn't support that solution because it could negatively affect text segmentation used by search engine indexing and natural language processing tools.