I have text containing multi-byte characters as shown:Counting the number of multi-byte characters
ウィキペディア、百科事典。
台数(λ - 、lambda - )はする。 1930年代だ。関数s(x、y)= x * x +入力xである。 x↦xとy ↦yは変数の名前は。また、(x、y)↦x * x + y * yと(u、v)↦u * u + v * vは.123456
In a word processor、it gives me a character count of 148 。
On a HTML form encoded in UTF-8、it uses up a3210 field with attribute of maxlength = 150
。
Using the PHP function mb_strlen($_POST['text'],'UTF-8')
、it returns a value of 。
Which one is correct?
Which Word processor? Maybe they do not count newlines as characters? –
@ Yzmir Ramirez、libreoffice writer。 You are right、it does not count newlines。 Then why is there a difference between HTML and PHP? –