473,241 Members | 1,839 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,241 software developers and data experts.

Problems with Apache and special characters

Hi.

Running Apache/2.0.52 on Linux, I've got problems with special
characters
(Spanish tildes) on my pages. I can see them correctly on my machine
(España), but
not on my web server (España).

My test page is:
-------------------------
<html>
<h1>España</h1>
</html>
-------------------------

Within my 'httpd.conf' I set:
-------------------
AddDefaultCharset ISO-8859-1
-------------------

I don't know wether it's a problem of my webpages or of my webserver.
Any suggestion? Thank you very much.

Jul 17 '05 #1
12 3132
.oO(ta********@gmail.com)
Running Apache/2.0.52 on Linux, I've got problems with special
characters
(Spanish tildes) on my pages. I can see them correctly on my machine
(España), but
not on my web server (España).


Post an URL.

Micha
Jul 17 '05 #2
ta********@gmail.com wrote:
Running Apache/2.0.52 on Linux, I've got problems with special
characters (Spanish tildes) on my pages. I can see them
correctly on my machine (España), but
not on my web server (España).
Looks like some sort of Unicode.
My test page is:
-------------------------
<html>
<h1>España</h1>
</html>
-------------------------
Are you sure your test page isn't encoded in UTF-8 or Unicode or
whatever (something different than ISO-8859-1)?
Within my 'httpd.conf' I set:
-------------------
AddDefaultCharset ISO-8859-1
-------------------

I don't know wether it's a problem of my webpages or of my webserver.
It's a problem of both and neither: they're not in synch!
Any suggestion? Thank you very much.


Try:

<h1>Espa&ntilde;a</h1>

and the encodings for your server and pages no longer matter :-)

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Jul 17 '05 #3
.oO(Pedro Graca)
Try:

<h1>Espa&ntilde;a</h1>

and the encodings for your server and pages no longer matter :-)


I would rather fix the encoding issue instead of using entities.

Micha
Jul 17 '05 #4
ta********@gmail.com wrote:
Hi.

Running Apache/2.0.52 on Linux, I've got problems with special
characters
(Spanish tildes) on my pages. I can see them correctly on my machine
(España), but
not on my web server (España).

My test page is:
-------------------------
<html>
<h1>España</h1>
</html>
-------------------------

Within my 'httpd.conf' I set:
-------------------
AddDefaultCharset ISO-8859-1
-------------------
Try using UTF-8 instead. Your file is being served as ISO-8859-1 but
it's really encoded with UTF-8 (you get ñ when you try to decode a
UTF-8 'ñ' with the ISO-8859-1 decoder).

I don't know wether it's a problem of my webpages or of my webserver.
Any suggestion? Thank you very much.


You can else:
-tell your text editor to save your files using ISO-8859-1, or
-place the appropiate <meta> tag in your files so that the server and/or
browser know how to decode the file.

Jul 17 '05 #5
Dani CS wrote:
-place the appropiate <meta> tag in your files


Fine; but that's no substitute for HTTP headers. Even
though a server might form HTTP headers from http-equivs, I
see no reason not to remove any doubt and instruct the
server yourself.

--
Jock
Jul 17 '05 #6
John Dunlop wrote:
Dani CS wrote:

-place the appropiate <meta> tag in your files

Fine; but that's no substitute for HTTP headers. Even
though a server might form HTTP headers from http-equivs, I
see no reason not to remove any doubt and instruct the
server yourself.


Instructing the server is easy when all the documents use the same
encoding. But this situation is far from real in many environments (eg.
my own machine -- Kate on Linux insists on UTF-8, but Crimson Editor on
Windows is stuck with ISO-8859-1).

However, there's a "per-file" way to instruct the server on encodings,
apart from <meta> tags:

<?php header("Content-Tye: text/html; charset=..."); ?>

This should work fine, but should be placed at the begining of those
files that don't use the default encoding assumed by the server.
Moreover, I believe that some programs exist that automagically guess
the encoding of a file; such a program could be executed for each file
served, and its output prepended in a Content-Type header. Downsides
are: significant performance hit, and possible wrong guesses that drive
the cliente mad.

Un saludo,
Dani.
Jul 17 '05 #7
.oO(Dani CS)
Instructing the server is easy when all the documents use the same
encoding.
I consider that as it should be.
But this situation is far from real in many environments (eg.
my own machine -- Kate on Linux insists on UTF-8, but Crimson Editor on
Windows is stuck with ISO-8859-1).


I would decide for one encoding and then only use software that's
capable of handling it.

Micha
Jul 17 '05 #8
.oO(John Dunlop)
Dani CS wrote:
-place the appropiate <meta> tag in your files


Fine; but that's no substitute for HTTP headers. Even
though a server might form HTTP headers from http-equivs, I
see no reason not to remove any doubt and instruct the
server yourself.


The whole situation with the meta-charset-thing is rather paradox: The
information about the used encoding is stored inside the document, so
the UA has to decode the document first to know how to decode it ...

Stupid.

Micha
Jul 17 '05 #9

"Michael Fesser" <ne*****@gmx.net> wrote in message
news:hp********************************@4ax.com...
.oO(John Dunlop)
Dani CS wrote:
-place the appropiate <meta> tag in your files


Fine; but that's no substitute for HTTP headers. Even
though a server might form HTTP headers from http-equivs, I
see no reason not to remove any doubt and instruct the
server yourself.


The whole situation with the meta-charset-thing is rather paradox: The
information about the used encoding is stored inside the document, so
the UA has to decode the document first to know how to decode it ...

Stupid.

Micha


Not if you supply that information on an HTTP header, as in:-

header('content-type:text/html; charset=UTF-8');

--
Tony Marston
http://www.tonymarston.net


Jul 17 '05 #10
Michael Fesser wrote:
The whole situation with the meta-charset-thing is rather paradox: The
information about the used encoding is stored inside the document, so
the UA has to decode the document first to know how to decode it ...


The HTML4.01 spec says:

| The META declaration must only be used when the character
| encoding is organized such that ASCII-valued bytes stand
| for ASCII characters (at least until the META element is
| parsed). META declarations should appear as early as
| possible in the HEAD element.

http://www.w3.org/TR/html401/charset...-char-encoding

See also news:c5************@ID-114100.news.uni-berlin.de .

(Sorry, I don't know how best to refer to threads in groups-
beta (spit). That's the message-id of the first article.)

--
Jock
Jul 17 '05 #11
.oO(Tony Marston)
Not if you supply that information on an HTTP header, as in:-

header('content-type:text/html; charset=UTF-8');


That's how it's supposed to be. If I do it correctly in the server's
response header I don't need that meta-thing anymore.

Micha
Jul 17 '05 #12
.oO(John Dunlop)
See also news:c5************@ID-114100.news.uni-berlin.de .

(Sorry, I don't know how best to refer to threads in groups-
beta (spit). That's the message-id of the first article.)


Then use the "old" Google Groups. ;)

http://groups.google.com/groups?thre....uni-berlin.de

Interesting thread BTW.

Micha
Jul 17 '05 #13

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

Similar topics

3
by: New to PHP | last post by:
I have 3 computers with Ethernet connection to a local router box(SMC7008ABR) and on the wan side to Verizion DSL. I was able to install Apache and PHP on one of the PC with XP Home edition. How...
6
by: John Dean | last post by:
Hi I have set up httpd.conf according to installation and configuration instructions in the mod_python documentation. Yet when I enter the following URL http://localhost/test.py all I get is an...
7
by: John | last post by:
I am having problems with special characters with database calls (if I'm referring to this in the right way). the problem is with apostrophes of all things. If an end user puts an apostrophe in...
5
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
14
by: Jim Carlock | last post by:
I have a couple easy questions possibly. 1) Is there a default.php page? The webserver seems to support default.htm, default.html, index.htm and index.html. It's an Apache server, I'd like to...
10
by: jcsnippets.atspace.com | last post by:
Hi everybody, I'm trying to read a file containing a list of addresses. Most of these addresses are based in Germany, so there are a lot of names which have special characters like München and...
13
by: Massimo Fabbri | last post by:
Maybe it's a little OT, but I'll give it try anyway.... I was asked to maintain and further develop an already existing small company's web site. I know the golden rule of "eternal" URIs, but...
2
by: karen987 | last post by:
Can someone please tell me how to alter this code if it needs altering, . thanks in advance. 1. The form keeps focusing on "username" and won't submit. The 2 username functions may be clashing?...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...

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.