473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Euro Symbol

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

Similar topics

2
10553
by: VK | last post by:
Hello All I am writing a string from the database into a text file which contains "Euro" symbol . I have tried using iconv() and utf_encode and mb_convert_encoding() functions to convert the...
11
12782
by: MH | last post by:
Thai may have been asked before but I'm new here.... How can I put the Euro symbol, ? using alt0128 in my page and get it validated as HTML 4.01 ? -------------- MH
18
6487
by: gabriel | last post by:
greetings, I am currently working on a website where I need to print the Euro symbol and some "oe" like in "oeuvre". If I choose this : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
2
4604
by: tilmann | last post by:
We are using ASCII-Tablespaces with the Codepage 819 on z/OS. We're now having a problem with the EURO symbol. The data is inserted from a Windows-Client, running Codepage 1252. The Euro symbol is...
0
1299
by: Victor | last post by:
Hi, i have a textbox field and before to send it by post i have the htmlencode command to "format" this field but i have a problem, euro symbol (€) travels as ? and i don't know why, i have choose...
7
10608
by: Robertu | last post by:
Hi at all I'ld want inserrt into my emails body the ? euro symbol therefore I wrote the header of my emails like : $headers="From: $mail_from\n\r"; $headers.='X-Mailer: PHP/' ....
1
2568
by: AAGazer | last post by:
Hi, For some reason str_ireplace and str_replace do not remove the euro symbol. This is the code snip it: $mremoveArray=array("€","£"); $tString=”15,00€”; ...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.