I would like to replace invalid UTF-8 chars with quotation marks (PHP 5.3.5).
So far I have this solution, but invalid characters are removed, instead of being replaced by '?'.
function replace_invalid_utf8($str)
{
return mb_convert_encoding($str,…
I am trying to do a composer install ..., but getting an error of requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. I am using Apache (Cpanel) and PHP 5.6.
Below are the ways I am trying to fix the…
I want to migrate my web server from unsupported version of ubuntu 12.10.
I installed 16.04 and installed apache2, php7, mysql and phpmyadmin.
When I want to use phpmyadmin I have error that mbstring missing.
In PHP.ini file, there is only to enable…
I am using almost the latest version of php (5.5.11) and here is the problem. When I use json_encode of the part of the string, it returns false. In the beginning I was using substr, but then I realized that this is totally wrong when dealing with…
So I'm having a problem where I believe what's happening is I'm receiving data that uses some unicode spaces and some ascii spaces, such that certain strings that appear the same are not equivalent, for example, "water resistant" != "water…
The mbstring PHP module has a strict_detection setting, documented here. Unfortunately, the manual is completely useless; it only says that this option "enables the strict encoding detection".
I did a few tests and could not find how any of the…
I have a problem with UTF-8 and mb_strtoupper.
mb_internal_encoding('UTF-8');
$guesstitlestring='Le Courrier de Sáint-Hyácinthe';
$encoding=mb_detect_encoding($guesstitlestring);
if ($encoding!=='UTF-8')…
I'm getting error
Call to undefined function FOS\UserBundle\Util\mb_convert_case() app_path/vendor/bundles/FOS/UserBundle/Util/Canonicalizer.php on line 18
It occurs when I try to load fixtures.
First step was to install mbstring.so ext, so I…
I run on Amazon linux 2 AMI, With PHP 7.2.5 and apache
The probleme is: Call to undefined function mb_convert_encoding
The initial need is to be able to read an uploaded text file correctly and have its content inserted in DB, knowing that the…
I am new to docker and I'm trying to set it up in order to run with Laravel 5.1. I am currently getting the following error
Call to undefined function Illuminate\Foundation\Bootstrap\mb_internal_encoding() in…
Is there a way to determine for sure the minimum number of bytes required by a character in a specific encoding? Like one of the encodings supported by the mbstring extension. The value will be 1 for UTF-8, 2 for UTF-16, etc.
I don't want to obtain…
For some reason, when running mb_convert_encoding in phpunit, I am getting unexpected results. For example doing the following:
var_dump( mb_convert_encoding( utf8_decode( 'ö' ), 'UTF-8' ) === 'ö' )
The above returns bool (true) under PHP-FPM, and…
i just started dabbling in php and i'm afraid i need some help to figure out how to manipulate utf-8 strings.
I'm working in ubuntu 11.10 x86, php version 5.3.6-13ubuntu3.2. I have a utf-8 encoded file (vim :set encoding confirms this) which i then…
My website is fully converted to use utf-8, (mysql, http headers, PHP mb_string etc).
Im doing some penetration testing and trying to POST invalid utf to one of the scripts (using BurpSuite).
But when I post the invalid utf, an just hex-dump the…
I know that there is no mb_trim version of the trim. I have links to the dozen of articles for how to implement one using preg_replace.
The question I have, is the usual trim with default chars mb safe? That is, is there any example of multibyte…