473,597 Members | 2,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4890
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...@yaho o.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
8143
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 like Microsoft's 'smartquotes'), and outputs the file. The problem is these files will be on disk, so the program won't have the character encoding information from the server. Questions:
7
4953
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 windows-1252 and that it is not equivalent to iso-8859-1. Looking in the registry under HKEY_CLASSES_ROOT\MIME\Database\Charset and \Codepage, it seems that all variations on iso-8859-1 (latin1, etc) are mapped to code page 1252, which I'm...
6
2501
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 POST request to the server with data, and the server has ASP.NET application that handles the request and gives answer. I have biled all the fat code down to a very simple test case, which consists from three files - HTML page, which does...
18
4607
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 has some different characters in it that I am trying to remove. The small a with two dots over it and the small y with two dots over it. Here is my code so far to remove the small y: Private Sub Button2_Click(ByVal sender As System.Object, ByVal...
8
11862
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
3360
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
9453
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 convert text input in HTML forms from the
5
4882
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() and htmlentities() will only convert characters that have an associated entity defined in HTML.
17
10637
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 talking with another team -- codepage -- at the same time. I am more confused when I saw sometimes we need codepage parameter for wide character conversion, and sometimes we do not need for conversion. Here are two examples,
10
3966
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 instance, one of the characters has an ASCII code of 150 (it looks like a dash '-'), when I'm debugging this character is displayed as the square box that Windows uses for unsupported characters and when it's copied to the database it's stored as...
0
7962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5844
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.