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

Problem: Euro sign in sending email !

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
7 3292
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
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
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
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
<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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rutger Claes | last post by:
I have a dom tree representing the content of a html document. In the xml I use &#x20AC; as the euro sign. I think I need to do this to be able to use xsl transformations. After the xsl...
2
by: SPG | last post by:
Hi, I am haveing some problems with getting the correct XML response from a Servlet. I have data that contains the euro sign ( 0x80 = ?) and the string I am trying to print out to the response...
1
by: Damjan | last post by:
Hi All, I have just spent 2 days tring to display euro sign in html which is obtained from xml and xsl. After you would not beleive what kind of research it came down to that when I load the...
1
by: Marco W | last post by:
Hi, <xsl:value-of select="translate(current(),'€','EUR')" /> only replace the euro sign with 'E' and not 'EUR'. How can I replace the euro sign in the string 'EUR'?
8
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server...
0
by: kingski | last post by:
Any idea about this? http://www.developerfusion.co.uk/forums/thread/114379/#114379 "Can any one help me as i am building a shopping cart and it supports multiple currencies but while sending...
4
by: Kim | last post by:
Inserting a record through sql (asp, msaccess textfield), inserting the euro sign "?" shows up like a questionmark "?" in the output. I have <%@ LANGUAGE="VBSCRIPT" CodePage=28591 LCID=2077 %at...
1
by: cvschie | last post by:
Hi, I have a LED Sign with standard software to control messages (via serial port). Because the limitations of the software I want my own VB.net program. With a serial analyzer program, I see...
3
by: Georg Weiler | last post by:
Hi, I have a database PostgreSQL entry that includes the string € which is the euro sign. When I retrieve the string through a PHP SQL statement and then echo the result to the browser, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.