GaryL
September 11, 2017, 1:52am
#1
akhilkumar332Staff12h Helped me with this topic late in August 2017
My website is
https://exper17.000webhostapp.com/
The specific subpage is
https://exper17.000webhostapp.com/gmvolt.php
I started with an htlm/css website that I wrote, and got tired of of re-writing the NAVBAR on each page, so I made a php page to contain the NAVBAR. I call the NAVBAR with the command
<?php include('navbar.php');?>
Works Beautifly, except that apostrophes and quotation marks
get written to the screen as question marks
On akhilkumar’s advice I added this to .htaccess
AddDefaultCharset Off
AND I put this (started line with <)
meta charset=“utf-8” >
into the head of:
exper17.000webhostapp.com/gmvolt.php
Note: 1st character in each line below is <
Preview won’t reproduce line if I start it with <
!DOCTYPE html>
html>
head>
title>GM Volt Writer
meta charset=“utf-8” >
meta name=“description” content=“GM Volt” />
link href=“stylesheet.css” rel=“stylesheet” type=“text/css” />
head>
I also tried
meta charset=“utf-8” />
because of some suggestions I found online
I also tried some other charsets besides utf-8
Can someone tell me where I’m in error?
Try this
<!DOCTYPE html>
<html>
<head>
<title>GM Volt Writer</title>
<meta charset=“utf-8” >
<meta name=“description” content=“GM Volt” />
<link href=“stylesheet.css” rel=“stylesheet” type=“text/css” />
</head>
GaryL
September 11, 2017, 7:36am
#3
Hi ckhawand,
As I type stuff in this window, I notice that some html statements just do not show up in the preview window. In my last note, I was trying to get around that problem, without success.
If you could go to
https://exper17.000webhostapp.com/gmvolt.php
you’ll see the problem, and if you hit Ctrl+U, you’ll see I already have exactly as you suggest.
Good! At least I’m on the right track, but can you see what I’m doing wrong?
1 Like
GaryL
September 11, 2017, 8:05am
#5
Yes, that’s it exactly!
Add this to your php script
header(“Content-type: text/ html; charset=utf-8”);
GaryL
September 11, 2017, 8:22am
#7
where, in
https://exper17.000webhostapp.com/gmvolt.php
do I put it?
in the header? Before the header? after it?
I really don’t know anything about php, except that one command
<?php include('navbar.php');?>
Put it after the include line
GaryL
September 11, 2017, 8:38am
#9
I tried it, but no luck, it didn’t work
Supun
September 11, 2017, 9:36am
#10
Do you load HTML content from your database?
Put this inside <head>
tag.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
GaryL
September 11, 2017, 5:21pm
#11
Hi Supon,
I put it in
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
It didn’t help
Actually, ckhawand suggested something similar earlier
<meta charset=“utf-8” >
It didn’t work, either
Supun
September 11, 2017, 5:33pm
#12
What is the text editor you use?
GaryL
September 11, 2017, 5:45pm
#13
I used Microsoft’s Text editor. The files it creates, the files that I upload to the server are ascii
Supun
September 11, 2017, 5:50pm
#14
This is a weird problem. Can you try using Sublime text and try again.
GaryL
September 11, 2017, 5:54pm
#15
Hi Supon,
What is Sublime text? Won’t it just produce ascii? Isn’t ascii just ascii, no matter where it comes from?
Can you type those ASCII characters on the forum?
GaryL
September 11, 2017, 5:58pm
#17
Hi Supon - I don’t understand - what would you like me to do?
Supun
September 11, 2017, 6:09pm
#18
Actually, i can’t tell you an exact answer. I guess it might be a problem with your text editors encoding. I asked you to try using Sublime Text. Download it and open your file with it. Then save it in encoding utf-8 and upload.
GaryL
September 11, 2017, 8:50pm
#19
Later tonight, I’ll see IF I can get either of my Ubuntu computers to work. If I can I’ll download Sublime Text – Thanks Again!
1 Like
GaryL
September 12, 2017, 5:55am
#20
Hi Supon,
It LOOKS like I solved the problem. I downloaded Sublime text from
http://tipsonubuntu.com/2017/05/30/install-sublime-text-3-ubuntu-16-04-official-way/
I opened the old ascii file
https://exper17.000webhostapp.com/gmvolt.php
and saved it as utf-8
I also opened another file I had the same problem with:
https://exper17.000webhostapp.com/scopejunction.php
and saved it as utf-8
They both seem OK
After I finish updating the whole website, I would be glad to write this up as some sort of application note, if you think it will be helpful. Please don’t close this yet, because I want to first see if any similar problems pop up.
Again - Thanks
2 Likes