3

P.S. : I'm using PHP 7.2.2 on my machine that runs on Windows 10 Home Single Language edition. I'm using PHP from the installed XAMPP v3.2.2

Consider all my doubts as regarding to PHP 7 only.

Please have a look at the following text from the Strings page of PHP Manual :

A string is 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.

The above text has raised so many questions in my mind as below :

  1. What does actually mean by "256-character set" in the context of PHP here? Which 256 characters are involved in this so called 256-character set? What is the official name of this "256-character set" in PHP context?
  2. What does actually mean by "Native Unicode Support"?
  3. I heard that abandoned PHP 6 release was about to incorporate "Native Unicode Support" but somehow it never got released and finally abandoned. So, I expected PHP 7 will incorporate "Native Unicode Support" but the manual is saying it still doesn't supported as of PHP 7? Why so?
  4. How PHP overcame this drawback in PHP 7 releases?
  5. Can the website be created in PHP which supports multiple languages, especially Indian Languages as PHP is not having "Native Unicode Support"?
PHPLover
  • 1
  • 51
  • 158
  • 311
  • 1
    Answer to your first question.... [ASCII](https://en.wikipedia.org/wiki/ASCII) – Mark Baker Nov 18 '17 at 16:01
  • 2. you need fancy functions to work with unicode. http://php.net/manual/en/ref.mbstring.php – Roland Starke Nov 18 '17 at 16:18
  • Most PHP core/string functions assume single-byte encoded ASCII/Latin-1 text. UTF-8 encoded strings typically do not pose a problem, but `strlen`/`substr` et al only deal on a byte-by-byte basis still. So what this means is: apart from specific regex/multibyte functions, PHP does not interpret character-encoding in strings per default. There's no `unicode`-type/default for strings such as in e.g. Python3. – mario Nov 18 '17 at 16:29
  • Possible duplicate of [What factors make PHP Unicode-incompatible?](https://stackoverflow.com/questions/571694/what-factors-make-php-unicode-incompatible) and/or [PHP 7 Unicode-support and platform-independence](https://stackoverflow.com/questions/31066789/php-7-unicode-support-and-platform-independence) – mario Nov 18 '17 at 16:31

1 Answers1

1
  1. It means first 256 (out of 1 114 112 possible characters; 17 x 65 536) characters of Unicode characters set.
  2. Native letters, like ą, č, etc.
  3. Native letters are placed at the end of Unicode set after 256 character position, so that's why PHP does not support it.
Justinas
  • 41,402
  • 5
  • 66
  • 96