mbstring

PHP string functions vs mbstring functions

非 Y 不嫁゛ 提交于 2019-12-02 07:00:57
问题 I have an application that has so far been in English only. Content encoding throughout templates and database has been UTF-8. I am now looking to internationalize/translate the application into languages that have character sets absolutely needing UTF-8. The application uses various PHP string functions such as strlen() , strpos() , substr() , etc, and my understanding is that I should switch these for multi-byte string functions such as mb_strlen() , mb_strlen() , mb_substr() , etc, in

PHP string functions vs mbstring functions

旧时模样 提交于 2019-12-02 02:07:26
I have an application that has so far been in English only. Content encoding throughout templates and database has been UTF-8. I am now looking to internationalize/translate the application into languages that have character sets absolutely needing UTF-8. The application uses various PHP string functions such as strlen() , strpos() , substr() , etc, and my understanding is that I should switch these for multi-byte string functions such as mb_strlen() , mb_strlen() , mb_substr() , etc, in order for multi-byte characters to be handled correctly. I've tried to read around this topic a little but

How to install mbstring extension

馋奶兔 提交于 2019-11-29 17:00:23
When I installed mbstring in Centos, I got the following error message. # yum install php-mbstring Loaded plugins: downloadonly, fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirror.vastspace.net * epel: ftp.riken.jp * extras: mirror.vastspace.net * updates: mirror.vastspace.net Resolving Dependencies --> Running transaction check ---> Package php-mbstring.x86_64 0:5.3.3-40.el6_6 will be installed --> Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package:php-mbstring-5.3.3-40.el6_6.x86_64 --> Finished

Missing mbstring PHP extension when installing phpMyAdmin on Mac

倾然丶 夕夏残阳落幕 提交于 2019-11-29 15:36:40
PhpMyAdmin install errors Having some issues with installing phpMyAdmin. I would like to resolve the following issue, but don't have a clue where to start (except maybe php.ini?). Here's the error message. The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results. And here's a related article I found on SO that was for Linux but didn't work on my Mac (OSX 10.6 with PHP updated, etc): PhpMyAdmin install errors Like the error message says, your PHP

How to enable mbstring from php.ini? [closed]

☆樱花仙子☆ 提交于 2019-11-29 06:30:42
问题 I have real difficulties with enabling mbstring extension on my localhost. I'm using XAMPP 1.7.4, for Windows, which has PHP 5.3.5, and tried to edit my php.ini file according to the documentation and various other examples I found online. After about 6 hours of this, all I managed to do is get a "Error 500 - Server error' message, that didn't go away even after I rolled-back all changes to the .ini file. What I need to do, is create PDF invoices with Danish characters, using tFPDF, to

PHP Security: how can encoding be misused?

◇◆丶佛笑我妖孽 提交于 2019-11-28 21:21:09
From this excellent " UTF-8 all the way through " question, I read about this: Unfortunately, you should verify every submitted string as being valid UTF-8 before you try to store it or use it anywhere. PHP's mb_check_encoding() does the trick, but you have to use it religiously. There's really no way around this, as malicious clients can submit data in whatever encoding they want , and I haven't found a trick to get PHP to do this for you reliably. Now, I'm still learning the quirks of encoding, and I'd like to know exactly what malicious clients can do to abuse encoding. What can one achieve

Composer - the requested PHP extension mbstring is missing from your system [closed]

回眸只為那壹抹淺笑 提交于 2019-11-28 17:21:38
I've recently tried to install package through Composer, but I have got an error the requested PHP extension mbstring is missing from your system. I removed semicolon from php.ini , but it still doesn't work. What should I do? Pranay Aryal sudo apt-get install php-mbstring # if your are using php 7.1 sudo apt-get install php7.1-mbstring # if your are using php 7.2 sudo apt-get install php7.2-mbstring find your php.ini make sure the directive extension_dir=C:\path\to\server\php\ext is set and adjust the path (set your PHP extension dir) make sure the directive extension=php_mbstring.dll is set

Missing mbstring PHP extension when installing phpMyAdmin on Mac

狂风中的少年 提交于 2019-11-28 08:59:22
问题 PhpMyAdmin install errors Having some issues with installing phpMyAdmin. I would like to resolve the following issue, but don't have a clue where to start (except maybe php.ini?). Here's the error message. The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results. And here's a related article I found on SO that was for Linux but didn't work on my

PHP: Split multibyte string (word) into separate characters

耗尽温柔 提交于 2019-11-28 08:26:09
Trying to split this string "主楼怎么走" into separate characters (I need an array) using mb_split with no luck... Any suggestions? Thank you! try a regular expression with 'u' option, for example $chars = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); An ugly way to do it is: mb_internal_encoding("UTF-8"); // this IS A MUST!! PHP has trouble with multibyte // when no internal encoding is set! $string = "....."; $chars = array(); for ($i = 0; $i < mb_strlen($string); $i++ ) { $chars[] = mb_substr($string, $i, 1); // only one char to go to the array } You should also try your way with mb_split

phpMyAdmin mbstring error

懵懂的女人 提交于 2019-11-27 19:36:12
Whenever I try to enter my phpMyAdmin, it gives me this error: The mbstring extension is missing. Please check your PHP configuration. I've looked all over the Internet for a fix, but all I've found is errors similar to mine, but not the same, or the exact same but there was no fix given. I am also using Windows. Arjang In Centos I have installed a php extension. I did this with: yum install php-mbstring Before sometime I also had the same problem. I have tried replacing the .dll file but no result. After some debugging I found the solution. I had this in my php.ini file: extension_dir = "ext"