I have written some croatian language in my page.But when i m seeing result some unsupported text is not coming on browser.This is replacing "?" there.what i have to do ?
I suggest using UTF-8 character encoding.
You should also convert your HTML files to UTF-8 character set (without BOM). You can do this using Notepad++ for example.
I have tested the following code and it is working:
<html>
<head>
<title>title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
vaše
</body>
</html>
Add encoding to your page, depending on what encoding you used to create your page, you need to add the following:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Or it's HTML5 equivalant
<meta charset="utf-8" />
Related
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
This file is in UTF-8 already with:
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
in the top but the word CAFÉ gets displayed as the following:
the HTML is:
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> form... </title>
</head>
<body>
CAFÉ
...
</body>
</html>
How do I fix it?
The document is in fact interpreted as windows-1252 encoded. The UTF-8 form of “É” consists of the two bytes 0xC3 0x89. Interpreted as windows-1252, they denote “Ô and “‰”.
The most probable cause is that the HTTP headers sent by the server specify windows-1252 as the encoding (or iso-8859-1, which actually means the same thing). This information overrides any meta tags in the document itself.
I have a strange situation.
I am specifying utf-8 in the meta data of my html file:
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
....
</head>
<body>
<? include("extras.php"); ?>
</body>
</html>
but my speacial characters "ä, ö, å" are being display incorrectly.
Even more strange through is that the same characters used int the included file (hard coded no loaded from php), are being displayed correctly?
can anyone enlighten me as to why this might be?
Encode the special characters, for example, the letter ä you should encode as ä
You can use an HTML encoder/decoder (there are many available online):
http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/encode.aspx
or do it programmatically.
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.
I want to read arabic characters from to text file and show them
but they are shown in a strange symbols like �
and they can't be compared with any characters
Let try to work on it together :
I will assume you code looks like :
1- your file should written in UTF8 encoding , i will take care if it's not
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<?php
$file_path = "c:/home/user/text.txt";
$data = file_get_contents($file);
// if its utf8 file skip this line
$arabic_data = iconv("windows-1256" , "utf8" , $data);
echo $arabic_data ; ?>
in case you are linux user you can use iconv in commandline much powerful & easier
I'll update my answer in case you need more help or provide more info
Try to create .htaccess file in the root of your web application and write such string there AddDefaultCharset UTF-8
You need to know the encoding of these files. Can be UTF-8, can be some transliteracion, can be something else. Then you have to convert to UTF-8 (not needed if are already utf-8), then you output that as in the page,... having the page declare itself as UTF-8... Like the Mira comment.
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
is life saver
if you working with php, use
echo '<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />';
in you scrip
Change file encoding to UTF-8
By open file by using any editor and change encode from editor to utf-8