Laravel localization shows unknown characters in Thai - php

I am translating all my messages to thai aside from en-us.
Now I have encountered a problem that an Unknown Question mark character shows up.
The code:
{!! trans('messages.client_dashboard') !!}
The expected result:
แดชบอร์ดลูกค้า
The result:
���ดชบอร์ดลูกค้า
I dont seem to understand why this happens. in my header there is the two
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
Any help would help greatly.

Try with installing some other Thai font on your system.

Related

Special Character Question Mark Show (Laravel Project)

I have problem with the special character (question mark) was shown to my content
All the suggestions I already use but still the question mark is showing.
Blade::setEchoFormat('e(utf8_encode(%s))');
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta charset="utf-8">
Sample text have question mark sign
$footersign = "©";
<div class="footer-copyright text-center py-3">{!! $footersign !!} <?php echo date("Y"); ?>
Hi-Flyer Food. Designed by Solutions Experts and Enablers, Inc.
</div>
Sample Image:
please change
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
to
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
because utf-8 can represent all characters hving iso-8859-1 also, try html entity name or number like
$footersign = "©"; or $footersign = "©";
instead of
$footersign = "©";
check your php file is encoded UTF-8 without BOM

UTF-8 Special Characters in PHP/Codeigniter not displaying correctly

I am working on a friends website, he complained that he could not enter £ on his product pages, instead they were appearing as black square with ? in them (�)
I have been digging around in the code for 2 days now and am unable to find the culprit.
I have a MySQL DB with all the data in it. The DB and table/field are all set to: utf8_general_ci
Looking at a record in PHPMyAdmin, the record shoes £ as expected.
However, when looking at the front end, the £ displays as a black square with a question mark in side of it.
I read in multiple places that is due to the browser not knowing it is UTF-8 character so I checked and all pages contain the following in the tags:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
The only way I can get it to display correctly is if I change the encoding via the browser to ISO-8859-1 or ammend the above meta tag to reflect the ISO-8859-1:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
Is anybody able to help me with what to try next?
Thanks for any help
Use this to the variable while output
$var = "£";
echo utf8_encode($var);
and make sure your
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
is in the header

special characters replaced by question mark

My website is replacing an apostrophe (') with a question mark (?) while rendering the page.
See the deal - my kitchen cook's at
www.dealschintu.com
It is a simple HTML page written by me which does the following
Connect to MySQL database
Retrieve title
Display
Add this between the <head> tags of your website:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
It should do the trick.
I got it working by changing the php file encoding from utf-8 to iso-8859-1

Two webpages displaying differently special spanish characters

I have a website where the web pages feed from the same database and I found that in two webpages that have same queries they interpretate the spanish special characters differently.
I cant really figure out what is wrong as I have stripped out the code which is interpreting the special spanish characters wrong and building it up from the scratch.
This one interpretes the characters well.
http://amragl.com/
This one interpretes the characters wrong.
http://amragl.com/menu.php
They both have the following
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
They both feed from the same database and use same queries.
Does anyone have any idea of how to fix this problem?
Thanks in advance.
--UPDATE-
PEASE SEE THE WORD "GAZPACH" or "AL LIM" to see the difference.
You have both
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
in the same file.
I suggest only using the utf-8 one.
Change iso-8859-1 to utf-8, should fix it.
The menu.php page is rendering with windows-1252 encoding, even tho it has iso-8859-1 set.
Are the menu.php contents coming from a database? If yes, which encoding is the database using?

How can I print special HTML characters correctly, using PHP?

I'm trying to print a string, like this:
Noticias de Fútbol.
But when I print this string, it displays like this:
Noticias de F�tbol.
I tried htmlspecialchar() and many more, but my output remains the same.
$str = "Noticias de Fútbol";
$strfoot = html_entity_decode($str);
How can I resolve this?
You don't need to use html_entity_decode, you can just simply print out your $str with echo, but you have to make sure your html has this line of code in the <head>:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
You have use charset utf 8 and htmlentities function of php
Like
<meta http-equiv="content-type" content="text/html; charset=utf-8">
$test=htmlentities("Sisälämpötila");
echo $test;
You are most likely outputting to a page that has the wrong charset specified. To confirm this open a JavaScript console and evaluate window.document.charSet and window.document.characterSet.
If that is the case you can use a meta tag to inform the browser of your intended charset:
<meta content="text/html; charset=utf-8">
I'm reading elsewhere the tag might be:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Your php file is not utf-8 but the browser is reading it as utf-8 which is giving you that question mark character. Save your file as utf-8, most editors/ides have options to set the charset of the file.

Categories