Hidden characters appear out of nowhere - utf-8

I have an HTML Code that keeps coming up with hidden characters. At first, it was the A characters in all the extra spaces which I removed. I tried the <meta http-equiv ="Content-Type " and content= "text /html; charset=UTF-8" /> That seemed to fix the issue.
However, now the code comes up with hidden ?????. I have rebuilt the code again but once it's put through our system it comes up with hidden ?????, how do I fix this? Or could this just be that our system is messing it up?
Please see the photos for reference. <meta http-equiv="Content-Type" and content="text/html; charset=UTF-8=" /> seemed to fix the A character issue

Related

UTF-8 Special Characters not working in header file

I am facing a strange issue with wkhtmltopdf. While in Footer and Content, all special characters are shown as supposed, in the header file, they don't show up or get replaced by blocks with a question mark. All of the three files are built the same:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
</body>
</html>
Is there some kind of trick to tell the header to use utf-8 to?
Btw, I am already telling wkhtmltopdf to use utf-8 not only as meta but also in the script call:
--encoding utf-8
EDIT: I am using an html-header (as you can see on the code I posted). Every 3 HTML files are built the same way. But while it is working in the content, the header don't likes my special chars. Maybe it is a problem that the content in the header comes from a $_POST variable while in the content, the text is built out of the db?

How to escape to htmlentities except for html tags in smarty

Example:
$smarty->assign('string', '<p>Germans use "Ümlauts" and pay in €uro</p>');
{$string|escape|unescape:"html"}
results in:
<p>Germans use 'Ümlauts' and pay in €uro</p>
What am I doing wrong...
You should also add UTF-8 to escape function as in documentation: http://www.smarty.net/docsv2/en/language.modifier.escape
There are more than one reasons why this can occur.
Check the encoding of
your php files,
your template files and
your html output (doctype and meta tags),
usually it is one of those which provokes this.
To avoid this kind of issue, in many cases the best way is to use utf8 throughout your project, which means converting smarty templates and php to utf8 and use proper utf8 tags in your html header.
HTML 4.01:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
HTML5:
<meta charset="UTF-8">

W3C validation - end tag for "meta" omitted, but OMITTAG NO was specified

I am getting an error as shown below
Error Line 6, Column 467: end tag for "meta" omitted, but OMITTAG NO was specified
…ta,Manufacturing_Industrial,Educational_Training,Teacher,Engineering_Projects">
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
How can I solve this ?
Please see the source code of the page below
<!doctype html>
<html>
<head>
<title>Jobslamp-free online resume creation and sharing,fresher jobs,experienced jobs,India jobs,Kerala jobs</title>
<meta name="keywords" content="Karnataka,Bangalore_Rural,Healthcare,Office_Assistant,Kerala,Ernakulam,IT_Hardware_Networking,Engineer,Sales___Marketing,Executive,Maharashtra,Mumbai_City,Retailing,Manager,Kollam,CRM_CallCentres_BPO_ITES_Med.Trans,Customer_Care,Hotel_Travel_Tourism_Airlines_Hospitality,Front_Office_Staff,Andhra_Pradesh,Hyderabad,IT_Software,Java_Developer,Pathanamthitta,Manufacturing_Industrial,Educational_Training,Teacher,Engineering_Projects">
<meta name="description" content="The best job oriented resume sharing system. Create and Publish your online resumes for FREE. Search and apply your dream jobs for FREE. Post your jobs for FREE.">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Thanks in advance
The error message points out the solution: replace the ending > with />.
<meta name="keywords" content="all your keywords" />
You'll need to fix the other meta tags the same way.

HTML unit displaying wrong characters

I'm using HTMLUnit. I am accessing the pages however special (Maltese) characters are being displayed wrongly. For example, ġuvni is displayed as ?uvni
HtmlPage page = submit_button.click();
System.out.println(page.asText());
I suspect it's an encoding problem, though I don't find any page.setPageEndoding or some similar method... Has anyone had such a problem before?
Thanks!
Make sure your page is in UTF-8 by putting this meta tag in your <head>:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Language characters showing as question mark boxes

I the following text (used for testing):
TÄSTåÄ
It's showing on the page as:
T�ST��
I have utf-8 as my content-type:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
I'm using font-family:
"lucida
grande",tahoma,verdana,arial,sans-serif
Any idea why thse characters won't show up properly?
Thank you!
You need to be sure that the file is being saved as a UTF-8 encoded file and not as plain text.
Pls make sure you saved file in 'UTF-8' or 'utf-8 without BOM'. If you used UTF-8 only for encoding your html page, please check the DOCTYPE is valid.

Resources