php / doc-en

English PHP documentation
499 stars 729 forks source link

wordwrap() should mention that it only supports ASCII characters #3433

Closed mfb closed 4 months ago

mfb commented 4 months ago

The manual page for wordwrap() at https://php.net/function.wordwrap says that the function "wraps a string to a given number of characters" but does not explicitly mention that it supports only ASCII characters.

MorganLOCode commented 4 months ago

Like the other string functions, it doesn't do "ASCII" or any other text encoding. As the manual says when it introduces the string type:

A string is a series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native Unicode support. (Note ASCII is only a 128-character set.)

Girgias commented 4 months ago

PHP's string type is effectively a byte-array. This "problem" affects every single string function, and something one should be aware of in general.

As this is already explained in the string type documentation, I am going to close this as won't fix.