Skip to main content
Participating Frequently
July 21, 2008
Question

GBP (£) sign

  • July 21, 2008
  • 7 replies
  • 993 views
I am currently working on an intranet system that uses ColdFusion and mySQL, the system is quite dated, whilst I've been adding and updating features I've come across a strange problem.

Simply put, when I insert a £ (GBP) sign into the database (processed with ColdFusion), and then output it using CF, it displays a small square box 'ᆪ' (as if the font doesn't have that character, Verdana, 10px). I have checked the value in the database using phpMyAdmin, and it displays the GBP sign correctly.

The page is using XHTML 1.0 Transitional doctype and 'iso-8859-1' charset.

Adding values into the database is done with a simple form, with no processing done from CF apart from a mySQL query to insert the data. Outputting the values is also simple, just grabbing the data from the query and printing it.

I have come across this solution using Google, however I have tried it twice without success.

We are running ColdFusion 7 with Windows Server 2003.
    This topic has been closed for replies.

    7 replies

    Inspiring
    July 24, 2008
    Chris Loftus wrote:
    > The db driver is MySQL (3.x), I'm pretty sure the encoding is 'latin1'?

    well latin1 should handle your currency symbol. what driver (jdbc or odbc)?

    i forgot to ask if you've used the cfprocessingdirective to change cf's encoding
    for the form & display pages?


    Participating Frequently
    July 22, 2008
    bump
    Participating Frequently
    July 21, 2008
    The db driver is MySQL (3.x), I'm pretty sure the encoding is 'latin1'?
    Inspiring
    July 21, 2008
    Stressed_Simon wrote:
    > Try changing it to £ instead that is the HTML entity for it!

    depending on the application that's not a good solution. won't sort right, can't
    be searched for properly (without some form of massaging), etc. and that still
    leaves the underlying encoding issue which will almost certainly bite him again
    somewhere down the line.
    Participating Frequently
    July 21, 2008
    Thanks Simon, £ works :-)

    Is there a function that will make this process more dynamic?
    Inspiring
    July 21, 2008
    Try changing it to £ instead that is the HTML entity for it!
    Inspiring
    July 21, 2008
    Chris Loftus wrote:
    > I am currently working on an intranet system that uses ColdFusion and mySQL,

    what version of mysql? what db driver?

    > Simply put, when I insert a ? (GBP) sign into the database (processed with
    > ColdFusion), and then output it using CF, it displays a small square box '?'

    verdana does contain that glyph but you can also see empty boxes when the
    encoding is just a bit off.

    > (as if the font doesn't have that character, Verdana, 10px). I have checked the
    > value in the database using phpMyAdmin, and it displays the GBP sign correctly.

    doesn't count--if the db's mangling that data, it's un-mangling it as well.

    > The page is using XHTML 1.0 Transitional doctype and 'iso-8859-1' charset.

    if you mean via metaheaders, doesn't matter to cf.

    > I have come across this
    > http://www.experts-exchange.com/Software/Server_Software/Web_Servers/ColdFusion/
    > Q_20983733.html using Google, however I have tried it twice without success.

    ignore the metaheader bits, nonsense as far as cf goes (but always add them for
    forensic reasons, screen readers, etc.).

    > We are running ColdFusion 7 with Windows Server 2003.

    ok, cf6 & above default to utf-8, so that's probably where the "minor" encoding
    mismatch is happening (or the db driver). have you tried

    <cfset setEncoding("form","iso-8859-1")>

    to your application.cfm?

    Participating Frequently
    July 21, 2008
    quote:

    what version of mysql? what db driver?

    MySQL 4.1.22-community-nt

    quote:

    ok, cf6 & above default to utf-8, so that's probably where the "minor" encoding mismatch is happening (or the db driver). have you tried

    <cfset setEncoding("form","iso-8859-1")>

    to your application.cfm?

    yep, no change