Apache Server configuration support - currency - not displayed as desired

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2006 > currency - not displayed as desired





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author currency - not displayed as desired
dj.brainstorm@gmail.com

2006-11-03, 1:19 pm

hi,

my currencies are not being displayed as expected... where i want =A3 i
get ? in one website and =C2=A3 in another (thats an oscommerce cart, it
sends email with that character in it too)

can anyone help me to correct this behaviour? its apache 2, running on
centos 4 operating system if that makes any diofference...


thanks


andy

Mike

2006-11-03, 1:19 pm

dj.brainstorm@gmail.com wrote:
> hi,
>
> my currencies are not being displayed as expected... where i want =A3 i
> get ? in one website and =C2=A3 in another (thats an oscommerce cart, it
> sends email with that character in it too)
>
> can anyone help me to correct this behaviour? its apache 2, running on
> centos 4 operating system if that makes any diofference...
>
>
> thanks
>
>
> andy


It doesn't necessarily sound like an Apache problem. Where are you
entering your " =A3" symbol? Is it going into a database (MySQL?
PostgreSQL?), is it being displayed from php code?

Thanks

Mike

shimmyshack

2006-11-03, 1:19 pm

yeah it sounds like its the character encoding that the browser is
using, which is either because it is following its own default, or
because you are sending it the wrong info.

My advice is to encode the character.
http://www.upsdell.com/BrowserNews/res_entities.htm
http://www.cs.tut.fi/~jkorpela/html/unicode.html
http://www1.tip.nl/~t876506/EntitiesXHTML1.html

Make sure you are sending the correct character encoding headers, and
give the same correct encoding meta info within the (x)html
The one that works for me is UTF-8, I send everything in UTF-8, if you
are sending xhtml strict then some browsers wont look at the meta info
about character encoding (they shouldnt) so again in makes sense to
send it along either using a dynamic language or using apache.

With the =A3 symbol some just say, type it in.

Mike wrote:
> dj.brainstorm@gmail.com wrote:
>
> It doesn't necessarily sound like an Apache problem. Where are you
> entering your " =A3" symbol? Is it going into a database (MySQL?
> PostgreSQL?), is it being displayed from php code?
>=20
> Thanks
>=20
> Mike


dj.brainstorm@gmail.com

2006-11-06, 1:18 pm

thanks for the replies.... i am not entirely sure where my problem
is.... i am in the process of switching a couple of websites from one
server to another and both websites are basically php / mysql
driven.... if i enter a =A3 sign on a php page (not using mysql) it is
displayed as a ?

the more complicated site is basically an oscommerce cart and it stores
=A3 signs in the mysql database as =C2=A3

the old server versions dispalyed a =A3 as a =A3 sign.... i have viewed
both servers in the same browsers (firefox usually) and they are
different....

would AddDefaultCharset in apache solve my problem? i've tried adding
this to the header of the page
<meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3Dutf-8" >

which doesn't help

any further advice would be much aprecciated....

thanks

shimmyshack

2006-11-06, 7:27 pm


it is all about being consistent, and then having users which have well
behaved browsers.
google groups sends
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8">
at the top of its pages, so all characters you type in will be
displayed to me as utf-8, if they werent originally utf-8 that will
mean i see a little black diamond with a question mark in it (as much
of you postings have so far contained)
have you checked to make sure your browsers are set on auto?
do you have a page where things are going wrong for you, and a
screenshot of what you see. so we can compare it. (if you use windows
do ALT+prtscn to capture the active window, and paste it into paint as
save as a jpg)

>
> the more complicated site is basically an oscommerce cart and it stores
> ? signs in the mysql database as =A3
>

Have you tried running the output from your database through a
html_entities function to make sure that all characters are html
encoded - this should solve a lot of your problems. In general anything
coming from the database should be validated since it can mess up your
page validation if something nasty comes out of it, (especially if you
allow users to input data into it)

>
> would AddDefaultCharset in apache solve my problem? i've tried adding
> this to the header of the page
> <meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3Dutf-8" >
>
> which doesn't help
>

what headers is your server sending? have you got the live headers
extensions, or the web developer toolbar, you can use these to
determine if you server is sending odd content type headers, which may
interfere with other settings.

> any further advice would be much aprecciated....

if you could send a url that illustrates your issues it would help.
this article is well worth a read, its what i read when i got started
on this, he is a utf-8 evengelist.


>=20
> thanks


shimmyshack

2006-11-06, 7:27 pm

http://www.joelonsoftware.com/articles/Unicode.html
soz forgot it!

dj.brainstorm@gmail.com

2006-11-07, 7:27 am

Hi,

firstly, here are a couple of urls which demonstrate my problem

http://www.edinburgh-audiovisual.co...ay-listings.php
(i added the google <meta http-equiv=3D"Content-Type" content=3D"text/html;
charset=3DUTF-8"> tag to the head tags which didn't help) -- in this
example GBP sterling pound signs (=A3) are shown as ? (a question mark)

and http://www.renegade-online.co.uk/ displays the shopping cart which
does display =A3 signs correctly where they are created by the cart
although they are stored in the mysql db as =C2=A3 .... emails are also
sent with =C2=A3 (there are some amazon ads on this page though which
display the pound sign as a question mark)

Both these sites are working perfectly on the old server
(www.thevenuedumfries.co.uk/seven-day-listings.php) &
(www.rencom.co.uk/oscommerce)

I am not sure of the difference.... I have downloaded one of the
firefox addons which i will have a look at and see if they can help....
I can provide screen shots if required.... re. the html entities, I
haven't done anything re. that but oscommerce is a cart which seesm to
have eveything builtin into it.... it obviously is using the correct
character to show my currency symbol on screen but for whatever reason
it is not the one i would expect (and want for a simple life)


anyway, thanks very much for your time..... i'll go and check the
server headers now


cheers


brian


shimmyshack wrote:
> it is all about being consistent, and then having users which have well
> behaved browsers.
> google groups sends
> <html>
> <head>
> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=

">[vbcol=seagreen]
> at the top of its pages, so all characters you type in will be
> displayed to me as utf-8, if they werent originally utf-8 that will
> mean i see a little black diamond with a question mark in it (as much
> of you postings have so far contained)
> have you checked to make sure your browsers are set on auto?
> do you have a page where things are going wrong for you, and a
> screenshot of what you see. so we can compare it. (if you use windows
> do ALT+prtscn to capture the active window, and paste it into paint as
> save as a jpg)
>
> Have you tried running the output from your database through a
> html_entities function to make sure that all characters are html
> encoded - this should solve a lot of your problems. In general anything
> coming from the database should be validated since it can mess up your
> page validation if something nasty comes out of it, (especially if you
> allow users to input data into it)
>
>
> what headers is your server sending? have you got the live headers
> extensions, or the web developer toolbar, you can use these to
> determine if you server is sending odd content type headers, which may
> interfere with other settings.
>
> if you could send a url that illustrates your issues it would help.
> this article is well worth a read, its what i read when i got started
> on this, he is a utf-8 evengelist.
>=20
>=20

dj.brainstorm@gmail.com

2006-11-07, 7:27 am

These are the headers from www.renegade-online.co.uk

Response Headers - http://www.renegade-online.co.uk/

Date: Tue, 07 Nov 2006 11:08:35 GMT
Server: Apache/2.0.52 (CentOS)
X-Powered-By: PHP/4.3.9
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=3D0,
pre-check=3D0
Pragma: no-cache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=3DUTF-8

200 OK

I have changed the oscommerce default charset to use UTF-8 so the pages
match the server headers. This didn't resolve my problem. I have also
changed the currency symbol used in oscommerce £ (thats
everyhting in the quotes without the spaces " & pound ; " which (in
conjucntion with setting my email type to html) has fixed my problem.

I will change all my references to the currency symbol in the other
mysql db accordingly too which will fix that particular problem too.


Many Many thanks for your help! Much apprecciated!


Brian

dj.brainstorm@gmail.com wrote:
> Hi,
>
> firstly, here are a couple of urls which demonstrate my problem
>
> http://www.edinburgh-audiovisual.co...ay-listings.php
> (i added the google <meta http-equiv=3D"Content-Type" content=3D"text/htm=

l;[vbcol=seagreen]
> charset=3DUTF-8"> tag to the head tags which didn't help) -- in this
> example GBP sterling pound signs (?) are shown as ? (a question mark)
>
> and http://www.renegade-online.co.uk/ displays the shopping cart which
> does display ? signs correctly where they are created by the cart
> although they are stored in the mysql db as =A3 .... emails are also
> sent with =A3 (there are some amazon ads on this page though which
> display the pound sign as a question mark)
>
> Both these sites are working perfectly on the old server
> (www.thevenuedumfries.co.uk/seven-day-listings.php) &
> (www.rencom.co.uk/oscommerce)
>
> I am not sure of the difference.... I have downloaded one of the
> firefox addons which i will have a look at and see if they can help....
> I can provide screen shots if required.... re. the html entities, I
> haven't done anything re. that but oscommerce is a cart which seesm to
> have eveything builtin into it.... it obviously is using the correct
> character to show my currency symbol on screen but for whatever reason
> it is not the one i would expect (and want for a simple life)
>
>
> anyway, thanks very much for your time..... i'll go and check the
> server headers now
>
>
> cheers
>
>
> brian
>
>
> shimmyshack wrote:
-8">[vbcol=seagreen]
es[vbcol=seagreen]
8" >[vbcol=seagreen]

shimmyshack

2006-11-28, 1:19 pm

it didnt occur to me at the time, dunno why, but in mysql5 the actual
connection has a charset, and you can set this like so

mysql_query("SET CHARACTER SET 'latin2'", $conn);

or

mysql_query("SET NAMES 'utf8'", $conn);

this page:

http://dev.mysql.com/doc/refman/5.0...connection.html

is really very good, along with this one:

http://ppewww.physics.gla.ac.uk/~fl.../checklist.html

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com