PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 9, 2022

[FIXED] HTML not supporting arabic language

 March 09, 2022     codeigniter, html, javascript, jquery, php     No comments   

Issue

I am working on a project which i need to convert it in Arabic. i am using codeigniter. when I write the Arabic in html it show me that (?????) for Arabic.

This is my HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title></title>
<meta name="" content="">
</head>
<body>
<h1 dir='rtl'
lang='ar'>checking</h1>
<p dir="rtl" lang="ar" style="color:#e0e0e0;font-size:20px;">رَبٍّ زِدْنٍي عِلمًا</p>
</body>
</html>

it shows me text like that:
enter image description here


Solution

As i can see you are using some html5 based attributes like dir so you need to convert the html4 document to html5 doctype and use lang attribute on html tag and meta tag:

<!DOCTYPE HTML>
<html lang="ar">
    <head>
       <meta charset="utf-8">

A sample demo is below:

<h1 dir='rtl' lang='ar'>checking</h1>
<p dir="rtl" lang="ar" style="color:#e0e0e0;font-size:20px;">رَبٍّ زِدْنٍي عِلمًا</p>

the view source of this snippet looks something like this:

enter image description here




Answered By - Jai
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing