Gujarati font not displayed correctly - html

I have written some Gujarati text as follows in html page.
Test Prescribbed/તપાસ કરાવવી
But the browser shows like
Test Prescribed/તપાસ કરાવવી.
Please give the solution

Add request.setCharacterEncoding("utf-8"); to your HTML page.

Actually gujarati fonts are in utf-8 format. If you are using Gujarati then in your html page following line should be there.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
But you should remove other specifications like if you are using jsp page than
<%# page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
line should be removed because you are specifying in meta tag. You need only meta tag.

Add the following line in your HTML.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Related

character encoding in a html page

I have 2 html pages (index.html and game.html) where I specify the same character encoding UTF-8
in the first page (index.html) every thing works fine but in the second page all characters appear like this �
this is the code of 2 pages :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> أصوات</title>
</head>
<body dir="rtl" lang='ar' class="contentBack">
</body>
</html>
the result in my browser:
how can I solve this problem ?
Make sure the file is also saved with the corresponding encoding (in your case UTF8). Setting the right meta charset may not be enough.

Meta Tag in HTML Mail is partly shown

We have vom .txt dokuments with our email content as HTML code.
Problem is, that we had to add some blank lines so the meta tag is not shown in the mails.
Until now, we had 5 blank lines, but with the Greek mails we need around 20 blank lines for this.
Is there a less ugly solution for this problem?
The affected meta tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
The Code in the Document:
Subject:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0," />
<style type="text/css">
//some css
</style>
</head>
//followed by body
Example in Mail:
-equiv="Content-Type" content="text/html; charset=utf-8">
The Mail is displayed as coded after this line.
Can someone please help?
Thank you!
Your message should not display as HTML at all. We can only surmise that adding empty lines somehow exposes a bug in some webmail clients. You should not be relying on this; you should send valid messages. Here is a simple minimal example of a valid HTML email message.
From: you <your.address#example.com>
To: recipient <their.address#example.net>
Subject: whatever you like
Mime-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0," />
<style type="text/css">
//some css
</style>
</head>
//followed by body
I don't think the http-equiv is even necessary any longer, given that the MIME content declaration already sets things up for properly displaying it, but YMMV.
The Content-Transfer-Encoding: 8bit means lines have to be shorter than some 1,000 characters. If that's a problem, maybe employ a different content-transfer-encoding (quoted-printable, perhaps; but then you have to program that, too).

meta tag should be an empty element tag

I am trying to enter the following meta tag in my jsp page using strut taglib
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" name="Webmaster" content="Telephone: <s:text name="webmaster.phone" /> , email:<s:text name="webmaster.email" />, address:<s:text name="webmaster.mail" />">
But a warning is showing that meta tag should be empty element tag. What should I do to solve this problem? Is there any other way to enter the webmaster information in the meta tag?
If your JSP declare a kind of xhtml DOCTYPE than the <meta> tag must be properly closed, as reported in Differences Between HTML and XHTML.
So your tag should be:
<meta
http-equiv="Content-Type"
content="text/html;
...
address:<s:text name="webmaster.mail" />"
/>
I had the same Eclipse warning in my html code and discovered it's b/c I didn't properly close the meta tag.
Example incorrect meta tag:
<meta name="description" content="blah blah">
Fixed by properly closing meta tag with "/>" :
<meta name="description" content="blah blah"/>

Background image not showing in jsp dynamic web project

Hi I am trying to use a background image in home.jsp page.when i run the project image is not loading a red cross mark is showing instead of the image
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%#taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="ac-styles.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Home Page</title>
</head>
<body >
<img src="img/bg.png">
<p> Hello This Is The Home Page For your J2ee Spring Application</p>
</body>
</html>
I had placed the image under
when i run the application the result is
please help..
Thanks in advance..
The JSP file is not in the same folder as of image file root folder is present. So either you have to move your .jsp file in web-content folder or you should use backspace commands like:
<img src="../../img/bg.png">
This should work.
Conversely the best method would be to migrate your image file in web-inf/views folder.That would be easy but not recommended for big projects.
note that I included "../" two times. In your directory structure it
is needed. For more information read the refering manual for HTML
src's.

local language characters not displayed when I use #include file

So the way I set up my website is users are redirected to the content page based on the QueryString value.
But the header stays the same.
Problem I am having is the local language characters.
They are not displayed in the content page even though meta-equiv is there when I check the source code.
What may be the problem here? How can I fix it?
Thanks a million..
<%
Section = Request.QueryString("Section")
If Section = "" then
%>
<!-- #Include File="home/index.asp" -->
<%
ElseIf Section = "home" then
%>
<!-- #Include File="home/index.asp" -->
<%
ElseIf Section = "friends" then
%>
Two things you can try
Open your page in Notepad and open the Save As box. What encoding is displayed? If ANSI is selected then change it to UTF-8
Add <%#CODEPAGE="65001"%> at the top of your asp page
Edit - I tried adding the following as a comment but I couldn't format it
You're seeing giriÅŸ instead of giriş
Look at your source code - it contains
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
it should contain
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />