By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,955 Members | 1,239 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,955 IT Pros & Developers. It's quick & easy.

Problem: Euro sign in sending email !

P: n/a
Any idea about this ?
http://www.developerfusion.co.uk/for...114379/#114379

"Can any one help me as i am building a shopping cart and it supports
multiple currencies but while sending confirmation mail o customer it does
not show euro sign before amount he paid but it is showing a queston mark
over there. It is working fine with Dollar sign and Pound Sign but this Euro
is creating problem. "

thanks.

Mar 3 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
In web.config, set the <globalization/> element's responseEncoding attribute
to an encoding which includes the Euro sign.

If you are writing files, set the fileEncoding, too.
If you are reading files, set the requestEncoding, too.

Also, make sure your browser is set to auto-detect encoding.

If the browser is set to a fixed encoding, it will use whatever it's set for,
instead of UTF-8, which is the default for the .Net Framework.

I use iso-8859-1 and that displays the Euro.
See : http://asp.net.do/test/EuroCurrency.aspx

You may need to set the correct culture, too, if you're using currency.
Here's the code for that page :

<%@ Page language="C#" debug="true" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="System.Threading" %>

<html>
<head>
<SCRIPT runat="server">

void Page_Load(){
String OutString = "";
CultureInfo DeCulture = new CultureInfo("de-DE", false);
Thread.CurrentThread.CurrentCulture = DeCulture;

NumberFormatInfo LocalFormat = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clo ne();
LocalFormat.CurrencySymbol = "DM"; // Replace currency symbol with DM sign.

Decimal myCurrency = new Decimal( 123456 );

myCurrency.ToString( "C", LocalFormat );

OutString = "Euro : " + myCurrency.ToString( "C", NumberFormatInfo.CurrentInfo );
OutString += "<br>" + "German Mark : " + myCurrency.ToString( "C", LocalFormat );

CultureInfo EnUSCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = EnUSCulture;
OutString += "<br>" + "US Dollar : " + myCurrency.ToString( "C", NumberFormatInfo.CurrentInfo );

CultureInfo esDOCulture = new CultureInfo("es-DO");
Thread.CurrentThread.CurrentCulture = esDOCulture;
OutString += "<br>" + "Dominican Peso : " + myCurrency.ToString("C", NumberFormatInfo.CurrentInfo);

CultureInfo nnNOCulture = new CultureInfo("nn-NO");
Thread.CurrentThread.CurrentCulture = nnNOCulture;
OutString += "<br>" + "Norwegian Krone : " + myCurrency.ToString("C", NumberFormatInfo.CurrentInfo);

Response.Write( OutString );

}
</SCRIPT>
</head>

<body>
</body>
</html>
---------------

HTH...

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"kingski" <sg*******@ssffghgg.com> wrote in message news:%2***************@TK2MSFTNGP14.phx.gbl...
Any idea about this ?
http://www.developerfusion.co.uk/for...114379/#114379

"Can any one help me as i am building a shopping cart and it supports
multiple currencies but while sending confirmation mail o customer it does
not show euro sign before amount he paid but it is showing a queston mark
over there. It is working fine with Dollar sign and Pound Sign but this Euro
is creating problem. "

thanks.

Mar 3 '06 #2

P: n/a
Thus wrote Juan,
In web.config, set the <globalization/> element's responseEncoding
attribute to an encoding which includes the Euro sign.

If you are writing files, set the fileEncoding, too. If you are
reading files, set the requestEncoding, too.

Also, make sure your browser is set to auto-detect encoding.

If the browser is set to a fixed encoding, it will use whatever it's
set for, instead of UTF-8, which is the default for the .Net
Framework.

I use iso-8859-1 and that displays the Euro.


ISO-8859-1 *does not* include the €. That's one of the reasons why we have
ISO-8859-15 among the ISO 8 bit encodings.

See also http://en.wikipedia.org/wiki/ISO_8859-1

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 3 '06 #3

P: n/a
Well, the page at http://asp.net.do/test/EuroCurrency.aspx
uses iso-8859-1 and displays the Euro, so I'm a bit mystified.

How coulde that happen, if iso-8859-1 doesn't include the Euro symbol ?

Here's the web.config for that file :

<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
culture="es-DO"
uiCulture="es-DO"
/>

Maybe Windows or .Net use a superset of the iso-8859-1 standard ?

My Regional settings are set to English/US, btw.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:94**************************@msnews.microsoft .com...
Thus wrote Juan,
In web.config, set the <globalization/> element's responseEncoding
attribute to an encoding which includes the Euro sign.

If you are writing files, set the fileEncoding, too. If you are
reading files, set the requestEncoding, too.

Also, make sure your browser is set to auto-detect encoding.

If the browser is set to a fixed encoding, it will use whatever it's
set for, instead of UTF-8, which is the default for the .Net
Framework. I use iso-8859-1 and that displays the Euro.

ISO-8859-1 *does not* include the ?. That's one of the reasons why we have ISO-8859-15 among the
ISO 8 bit encodings.

See also http://en.wikipedia.org/wiki/ISO_8859-1

Cheers, --
Joerg Jooss
ne********@joergjooss.de

Mar 3 '06 #4

P: n/a
Thus wrote Juan,
Well, the page at http://asp.net.do/test/EuroCurrency.aspx uses
iso-8859-1 and displays the Euro, so I'm a bit mystified.

How coulde that happen, if iso-8859-1 doesn't include the Euro symbol
?

Here's the web.config for that file :

<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
culture="es-DO"
uiCulture="es-DO"
/>
Maybe Windows or .Net use a superset of the iso-8859-1 standard ?


No, the answer is much simpler, though rather puzzling given your web.config
snippet: Your page uses UTF-8.

Here is what's actually being sent from your page in bytes: E2 82 AC -- which
is € encoded by UTF-8.

And BTW, check your browser: If it's set to auto detect encoding, it'll show
UTF-8 as encoding. Or manually switch to ISO-8859-1 to see the € go away.
Or use my sample ;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 4 '06 #5

P: n/a
<sigh>

That's twice I've stubbed my toe on that.
Thanks, Joerg.

re:
Here is what's actually being sent from your page in bytes: E2 82 AC -- which is ? encoded by
UTF-8.
I'm still having a hard time understanding how "Auto-Select"
could possible read the page's encoding as UTF-8,
when it's being encoded and sent by the server as iso-8859-1 :
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
I'm encouraged by this comment of yours :
"rather puzzling given your web.config snippet"

Indeed, Joerg, it's "rather puzzling" since encoding doesn't
occur by osmosis nor by browser intervention.

Again, I'm having a hard time understanding how my server can send UTF-8,
to be read by the browser as UTF-8, when everything is being encoded as iso-8859-1.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:94**************************@msnews.microsoft .com... Thus wrote Juan,
Well, the page at http://asp.net.do/test/EuroCurrency.aspx uses
iso-8859-1 and displays the Euro, so I'm a bit mystified.

How coulde that happen, if iso-8859-1 doesn't include the Euro symbol
?

Here's the web.config for that file :

<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"
culture="es-DO"
uiCulture="es-DO"
/>
Maybe Windows or .Net use a superset of the iso-8859-1 standard ?


No, the answer is much simpler, though rather puzzling given your web.config snippet: Your page
uses UTF-8.

Here is what's actually being sent from your page in bytes: E2 82 AC -- which is ? encoded by
UTF-8.

And BTW, check your browser: If it's set to auto detect encoding, it'll show UTF-8 as encoding. Or
manually switch to ISO-8859-1 to see the ? go away. Or use my sample ;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de

Mar 4 '06 #6

P: n/a
Thus wrote Juan,
<sigh>

That's twice I've stubbed my toe on that.
Thanks, Joerg.
re:
Here is what's actually being sent from your page in bytes: E2 82 AC
-- which is ? encoded by UTF-8.
I'm still having a hard time understanding how "Auto-Select"
could possible read the page's encoding as UTF-8,
when it's being encoded and sent by the server as iso-8859-1 :
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"


Well, the browser recognizes the encoding by parsing the charset attribute
of the Content-Type header:
Content-Type: text/xml; charset=utf-8
I'm encouraged by this comment of yours :
"rather puzzling given your web.config snippet"
Indeed, Joerg, it's "rather puzzling" since encoding doesn't occur by
osmosis nor by browser intervention.


It has to be some broken configuration on your side. If I run your page on
my machine and change web.config accordingly, the output is missing the €,
as expected. Whatever happens on your server, this particular page uses UTF-8.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 4 '06 #7

P: n/a
re:
Whatever happens on your server, this particular page uses UTF-8.
I feel like an ass.

I had done some tests ( that's why the virtual dir is called "test" );
had commented out the iso-8859-1 config and was actually using utf-8.

Thanks for your assistance.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:94**************************@msnews.microsoft .com... Thus wrote Juan,
<sigh>

That's twice I've stubbed my toe on that.
Thanks, Joerg.
re:
Here is what's actually being sent from your page in bytes: E2 82 AC
-- which is ? encoded by UTF-8.

I'm still having a hard time understanding how "Auto-Select"
could possible read the page's encoding as UTF-8,
when it's being encoded and sent by the server as iso-8859-1 :
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
fileEncoding="iso-8859-1"


Well, the browser recognizes the encoding by parsing the charset attribute of the Content-Type
header:
Content-Type: text/xml; charset=utf-8
I'm encouraged by this comment of yours :
"rather puzzling given your web.config snippet"
Indeed, Joerg, it's "rather puzzling" since encoding doesn't occur by
osmosis nor by browser intervention.


It has to be some broken configuration on your side. If I run your page on my machine and change
web.config accordingly, the output is missing the ?, as expected. Whatever happens on your server,
this particular page uses UTF-8.

Cheers,
Joerg Jooss

Mar 4 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.