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

Displaying Euro Symbol

P: n/a
I followed instructions in MSDN help articles and wrotethe folowing code in
order to display numeric numbers with Euro symbol as follows :
----------------------------
Dim OutString As [String] = ""
Dim frCulture As New CultureInfo("fr-FR", False)
Thread.CurrentThread.CurrentCulture = frCulture
Dim myCurrency As New [Decimal](123456)
myCurrency.ToString("C", LocalFormat)
OutString = "Euro : " + myCurrency.ToString("C",
NumberFormatInfo.CurrentInfo)
-----------------------------
Instead of getting
Euro : 123.456,00 €
The page is displaying
Euro : 123.456,00 ?
Am I missing a parameter somewhere?
Thanks
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi, SalamElias

Take a look at this sample code :

http://msdn.microsoft.com/library/de...ficculture.asp

Juan T. Llibre
===========
"SalamElias" <el******@online.nospam> wrote in message
news:4C**********************************@microsof t.com...
I followed instructions in MSDN help articles and wrotethe folowing code in
order to display numeric numbers with Euro symbol as follows :
----------------------------
Dim OutString As [String] = ""
Dim frCulture As New CultureInfo("fr-FR", False)
Thread.CurrentThread.CurrentCulture = frCulture
Dim myCurrency As New [Decimal](123456)
myCurrency.ToString("C", LocalFormat)
OutString = "Euro : " + myCurrency.ToString("C",
NumberFormatInfo.CurrentInfo)
-----------------------------
Instead of getting
Euro : 123.456,00 ?
The page is displaying
Euro : 123.456,00 ?
Am I missing a parameter somewhere?
Thanks

Nov 19 '05 #2

P: n/a
I is from this article I constructed my code. After I have posted my mail, I
rememebered that I gave changed the encoding in web.config from
<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8"/>
To <globalization fileEncoding="ISO-85....." requestEncoding="ISO-85......."
responseEncoding="ISO-85........"/>
I swithed back to urf-8, now the Euro symbol displaying correctly.

Any ideas of why this?
Thanks
"Juan T. Llibre" wrote:
Hi, SalamElias

Take a look at this sample code :

http://msdn.microsoft.com/library/de...ficculture.asp

Juan T. Llibre
===========
"SalamElias" <el******@online.nospam> wrote in message
news:4C**********************************@microsof t.com...
I followed instructions in MSDN help articles and wrotethe folowing code in
order to display numeric numbers with Euro symbol as follows :
----------------------------
Dim OutString As [String] = ""
Dim frCulture As New CultureInfo("fr-FR", False)
Thread.CurrentThread.CurrentCulture = frCulture
Dim myCurrency As New [Decimal](123456)
myCurrency.ToString("C", LocalFormat)
OutString = "Euro : " + myCurrency.ToString("C",
NumberFormatInfo.CurrentInfo)
-----------------------------
Instead of getting
Euro : 123.456,00 ?
The page is displaying
Euro : 123.456,00 ?
Am I missing a parameter somewhere?
Thanks


Nov 19 '05 #3

P: n/a
Hi SalamElias,

Thanks for your posting. I think the problem you mentioned is because the
"" symbol which could be displayed correctly under UTF-8 encoding but
failed under "ISO-8859-1" is because
"" is a three-bytes-character which can't be represented by ISO-8859-1(
Latin-1) charset, the ISO-8859-1 can only represent the standard
one-byte-charaters(0-127 is the standard ASCII CHARS). We can use the
following code to verify this;

Dim myCurrency As New [Decimal](123456)

Thread.CurrentThread.CurrentCulture = frCulture
Dim str As String = myCurrency.ToString("C",
NumberFormatInfo.CurrentInfo)
Dim flag As Char = str.Chars(str.Length - 1)

Response.Write("<br>" + flag.ToString())

Dim bytes() As Byte =
System.Text.Encoding.UTF8.GetBytes(flag.ToString() )

Response.Write("<br>length: " & bytes.Length)

the length will return 3 indicate that it is a multi-bytes char.

If there is anything unclear, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4

P: n/a
Steven Cheng[MSFT] wrote:
Hi SalamElias,

Thanks for your posting. I think the problem you mentioned is because
the "" symbol which could be displayed correctly under UTF-8
encoding but failed under "ISO-8859-1" is because
"" is a three-bytes-character which can't be represented by
ISO-8859-1( Latin-1) charset, the ISO-8859-1 can only represent the
standard one-byte-charaters(0-127 is the standard ASCII CHARS). We
can use the following code to verify this;


There's no concept of multibyte characters in ISO-8859-x -- these are simply
8 bit encodings, and ISO-8859-1 simply doesn't ccontain . It is contained
in ISO-8859-15, but using UTF-8 should be the preferred solution anyway.

Cheers,

--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss.de
Nov 19 '05 #5

P: n/a
Hi Joerg,

Thanks a lot for your correction. Yes, I think I've mistaken the "" char
for a multi-bytes one. Your point on the ISO-8859-x highlight this. Thank
again for your input.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.