Re: perfidious pound sign

Discussion in 'HTML' started by Christoph Michael Becker, Aug 21, 2013.

  1. lipska the kat wrote:

    > I have a shopping cart (home grown)
    > I extract a transaction as XML and use
    > javax.xml.transform.TransformerFactory
    > to transform the transaction into html which
    > is displayed as an invoice.
    >
    > The various totals and sub-totals are prefixed by the UK Pound sterling
    > prefix £
    > I use the exact same process to transform the xml in two places, once
    > when I show the invoice to a customer
    > just before they complete payment and once when I print the invoice.
    >
    > The problem comes when I try to display the £ sign
    > I'm currently using the html character code for currency characters
    > (in hex) £
    >
    > here's an example usage in invoice.xsl
    >
    > <td class='subtot'>
    > £<xsl:value-of select='@lineTotal'/>
    > </td>
    >
    > This works perfectly when I view the invoice to print it
    > but results in a ? when I display it to the user just before they checkout
    >
    > I use the same code when displaying the cart in a view
    > generated via AJAX and it works perfectly in fact it is only in this one
    > view that it fails
    >
    > I have tried everything I can think of to fix this but I've run out of
    > ideas
    >
    > Any ideas much appreciated


    The transformer object has a method setOutputProperty() which you should
    call with the appropriate encoding parameter:

    transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");

    --
    Christoph M. Becker
     
    Christoph Michael Becker, Aug 21, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry III

    Re: Pound Sign in text emails

    Jerry III, Oct 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    4,509
    Jerry III
    Oct 15, 2003
  2. =?Utf-8?B?bTAwbm0wbmtleQ==?=

    streamreader will not read UK pound sign!!!

    =?Utf-8?B?bTAwbm0wbmtleQ==?=, Nov 21, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,290
  3. T.J.
    Replies:
    10
    Views:
    1,433
  4. Jukka K. Korpela

    Re: perfidious pound sign

    Jukka K. Korpela, Aug 20, 2013, in forum: HTML
    Replies:
    4
    Views:
    596
    Jukka K. Korpela
    Aug 21, 2013
  5. Jukka K. Korpela

    Re: perfidious pound sign

    Jukka K. Korpela, Aug 28, 2013, in forum: HTML
    Replies:
    0
    Views:
    425
    Jukka K. Korpela
    Aug 28, 2013
Loading...

Share This Page