Skip to content

Tag: encoding

Laravel Blade Component – UTF-8 Encoding issue

I’m currently working on an application with Laravel 8 version. I have build a component named input-group which cause encoding issues that i don’t understand. The code of the component look like this : Here is the data that I inject into the value attributes => Inspecteur de l’Education …

PHP: Encode UTF8-Characters to html entities

I want to encode normal characters to html-entities like but doesn’t work. It outputs the normal charaters (a A b B) in the html source code instead of the html-entities. How can I convert them? Answer You can build a function for this fairly easily using mb_ord or IntlChar::ord, either of which will gi…

Why is mb_convert_encoding returning false?

Here is my code: If I call the above function with $password = “abc123!”, mb_convert_encoding returns false. Answer According to PHP Manual “auto” is expanded to “ASCII,JIS,UTF-8,EUC-JP,SJIS” But in my case it did not work correctly. If I try the following code instead of &…

PHP encoding Umlauts in .csv for Excel

I’m working on a PHP script that creates a .csv file from some data. Unfortunately, in Excel Umlauts are not displayed properly: Löl becomes L√∂l (this is just in Excel, in Apple’s Numbers, Atom and Textedit everything looks fine). I have tried hundreds of functions to try and get the encoding rig…

Apache unicode handling

I’m trying to duplicate existing apache behavior in a new server, but first need to understand how the current (Red Hat 4.4.7-23) one is working. The following php: Generates this output when run form the command line: Note that the json_encode fails because of the rogue unicode character. When requeste…