T
T
toaster khabrovich2016-01-15 11:34:48
PHP
toaster khabrovich, 2016-01-15 11:34:48

Is there an equivalent to normalize('NFC') in PHP?

MAC 10.6.8 MAMP 1.6
server sends an array to the client after scanning a directory:
$array = json_encode(scandir($_GET[path]));
the problem is that in the lines of this array, the characters Y and Y are bifurcated . The
solution to the problem is
that the javascript normalizes each line of the array:
element.textContent = array[x].normalize('NFC') // Y and Y are obtained as whole characters
, but the trouble is that the mobile client is not yet able to do normalize('NFC')
how to solve this problem?
Is there a php equivalent?
or maybe not use unicode?!!! Is this a normal idea at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Esin, 2016-01-15
@xotey83

There is an analogue. See there: php.net/manual/en/class.normalizer.php
You need "intl" extension

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question