Search code examples
phputf-8normalizationmbstring

Does mbstring normalize utf-8 strings?


I noticed that mb_convert_encoding always returns valid utf-8, which is great for cleaning up user input, but I wonder whether it will return a normalized form of utf-8 or whether I would have to do that manually after with the \Normalizer class?


Solution

  • Reading the source, mb_convert_encoding does not appear to normalize. It appears to convert between encodings then to substitute illegal characters, and that is all.