Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mfb opened this issue Jun 3, 2024 · 2 comments
Closed

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

mfb opened this issue Jun 3, 2024 · 2 comments

Comments

@mfb
Copy link

mfb commented Jun 3, 2024

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
Copy link
Contributor

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
Copy link
Member

Girgias commented Jun 14, 2024

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.

@Girgias Girgias closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants