473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Character encoding

I'm preparing a site for a client which includes several pages
containing Cyrillic characters. I used the UTF-8 charset, but the
Cyrillic characters appeared as question marks (and, oddly, some
Chinese characters as well.) I tried every Cyrillic charset I could
find and nothing worked.

I usually just hand-code all my PHP and HTML, but I swallowed hard and
went to Dreamweaver CS3, searched around, and found that I could set
each file's encoding to UTF-8 using the Modify =Page Properties =>
Title/Encoding command.

Now it works fine, but I don't really understand what the command did.
It didn't add any code, and it didn't change the http-equiv tag. In
fact, I have to perform the command on every file that is included in
the PHP file.

So: a) what exactly did Dreamweaver do, and b) how could I have hand-
coded whatever it is?

Thank you in advance.

(Also posted in alt.html -- my apologies if I've violated etiquette.)
Jun 27 '08 #1
7 4875
Mambo Bananapatch wrote:
I'm preparing a site for a client which includes several pages
containing Cyrillic characters. I used the UTF-8 charset, but the
Cyrillic characters appeared as question marks (and, oddly, some
Chinese characters as well.) I tried every Cyrillic charset I could
find and nothing worked.
So: a) what exactly did Dreamweaver do, and b) how could I have hand-
coded whatever it is?
Well it all depends on what exactly you do when you say "I used the
UTF-8 charset" or "I tried every Cyrillic charset"? Have you used an
editor that supports saving as UTF-8 (or a Cyrillic charset) and have
you used it so that it saved your documents as UTF-8 (or a Cyrillic
charset)? That is all what you need to do to ensure your files are
properly encoded. Then, when serving them over HTTP you need to make
sure the server sends a HTTP Content-Type response header indicating the
used charset as a paramter e.g.
Content-Type: text/html; charset=UTF-8

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #2
Scripsit Mambo Bananapatch:
(Also posted in alt.html -- my apologies if I've violated etiquette.)
Oh, you'll just be ignored in the sequel. No problem.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Jun 27 '08 #3
On Apr 26, 7:53 am, Martin Honnen <mahotr...@yahoo.dewrote:
Mambo Bananapatch wrote:
I'm preparing a site for a client which includes several pages
containing Cyrillic characters. I used the UTF-8 charset, but the
Cyrillic characters appeared as question marks (and, oddly, some
Chinese characters as well.) I tried every Cyrillic charset I could
find and nothing worked.
So: a) what exactly did Dreamweaver do, and b) how could I have hand-
coded whatever it is?

Well it all depends on what exactly you do when you say "I used the
UTF-8 charset" or "I tried every Cyrillic charset"? Have you used an
editor that supports saving as UTF-8 (or a Cyrillic charset) and have
you used it so that it saved your documents as UTF-8 (or a Cyrillic
charset)? That is all what you need to do to ensure your files are
properly encoded. Then, when serving them over HTTP you need to make
sure the server sends a HTTP Content-Type response header indicating the
used charset as a paramter e.g.
Content-Type: text/html; charset=UTF-8

--

Martin Honnen
http://JavaScript.FAQTs.com/
Thanks Martin, that's exactly what I did. Dreamweaver saved the files
with the correct encoding, and I used the response header you
suggested, and all's well.

I guess my question was more about what Dreamweaver did; if I were to
hand-code a page with Cyrillic characters, and didn't have access to
Dreamweaver, how would I encode each file? And why must I encode each
file, in addition to including the UTF-8 Content-Type response
header?

I just wanted to understand what I was doing.

Thanks for your time.

MB
Jun 27 '08 #4
Hello!

You did not really answer Martin's question - what did you do _before_
you decided to use Dreamweaver.
On a non-Russian OS one can get question marks in many cases, for
example:
- typing in an editor such as Notepad and save as "ANSI", that is, in
a character set encoding = system code page
- using copy/paste between Unicode and not-Unicode programs
- converting to UTF-8 without explicitely providing source encoding
and thus system code page is assumed
- etc.

You may want to read some explanations on my site:
- section "for developers: Cyrillic (Russian) in HTML"
- section "for developers: Cyrillic (Russian) in Multilingula HTML -
UTF-8"
- chapter "Copy/Paste; Word, .TXT" in the section
"Unicode and Cyrillic"

:)

--
Regards,
Paul
http://RusWin.net
Jun 27 '08 #5
On Sun, 27 Apr 2008, Mambo Bananapatch wrote:
if I were to
hand-code a page with Cyrillic characters, and didn't have access to
Dreamweaver, how would I encode each file?
You do not write with a pencil, do you? You have some editor
(word-processor, etc.) on some operating system on some computer.
We don't know what they are - but you know. Your editor saves
files in some character set, such as

MacCyrillic
http://www.unics.uni-hannover.de/nhtcapri/cyrillic.mac

ISO-8859-5
http://www.unics.uni-hannover.de/nht...cyrillic.html5

Windows-1251
http://www.unics.uni-hannover.de/nhtcapri/cyrillic.win

Unicode UTF-8
http://www.unics.uni-hannover.de/nht...gual1#cyrillic
And why must I encode each
file, in addition to including the UTF-8 Content-Type response
header?
I don't understand what this question means.

--
Top-posting.
What's the most irritating thing on Usenet?
Jun 27 '08 #6
On 2008-05-01, David Trimboli <da***@trimboli.namewrote:
[...]
Normally the browser learns what encoding to read by the server's HTTP
headers. An http-equiv declaration in an HTML file is a way to override
a server's content-type (encoding).
It doesn't override it-- if both are present, the server header wins.
You only use this if your server isn't serving files with the correct
content-type.
Yes, or because you're using file:// urls during development.
Jun 27 '08 #7
On Thu, 1 May 2008, David Trimboli wrote:
An http-equiv declaration in an HTML file is a way to override
a server's content-type (encoding).
No, it is not. See
http://www.unics.uni-hannover.de/nht...a-http-equiv.1
http://www.unics.uni-hannover.de/nht...a-http-equiv.2

--
Bugs in Internet Explorer 7
http://www.unics.uni-hannover.de/nhtcapri/ie7-bugs
Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
7
by: Mark | last post by:
Hi... I've been doing a lot of work both creating and consuming web services, and I notice there seems to be a discontinuity between a number of the different cogs in the wheel centering around...
6
by: Pavils Jurjans | last post by:
Hello, I am experiencing a weird behaviour on my ASP.NET project. The project consists from client-side, which can be whatever environment - web page, EXE application, etc. The client sends HTTP...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
8
by: Brand Bogard | last post by:
Does the C standard include a library function to convert an 8 bit character string to a 16 bit character string?
37
by: Zhiv Kurilka | last post by:
Hi, I have a text file with following content: "((^)|(.* +))§§§§§§§§" if I read it with: k=System.IO.StreamReader( "file.txt",System.Text.Encoding.ASCII); k.readtotheend()
44
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall...
5
by: Timothy Madden | last post by:
Hello Is there a function that will allow me to output text written in utf-8 (from db for example) if my document has Content-Type: text/html; charset=ISO-8859-1 I mean htmlspecialchars()...
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
10
by: Paul W | last post by:
Hi all, I have an application that reads data in from a text file and stores it in a database. My problem is that there are some characters in the file that aren't being handled properly. For...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.