Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

euro symbol €

Status
Not open for further replies.

Matsul

IS-IT--Management
May 6, 2002
140
BE
How can I set a string as follows

string mm="amt (€)"; ?

When I display I am getting

amt (€)

thanks for any help.
 
Do you still get the same behaviour if you use:
Code:
char c = '€';
int val = (int)c;
string amount = " amt (" + Convert.ToChar(val) + ")";
MessageBox.Show(amount);
Also, how are you displaying it when it displays incorrectly?

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
I am doing

private DataTable CreateDataTable()
{
DataTable myDataTable = new DataTable();

DataColumn myDataColumn;

myDataColumn = new DataColumn();
myDataColumn.DataType = Type.GetType("System.String");
myDataColumn.ColumnName = "Herberekend (€)";
myDataTable.Columns.Add(myDataColumn);

myDataColumn = new DataColumn();
myDataColumn.DataType = Type.GetType("System.String");
myDataColumn.ColumnName = "Te crediteren (€)";
myDataTable.Columns.Add(myDataColumn);

return myDataTable; }

then displaying in excel.

private void exportToExcell()
{
if (Session["myDatatable"] != null)
{
System.Data.DataTable DT = Session["myDatatable"] as DataTable;
if (DT != null)
{

//clear anything in io buffer
Response.Clear();
//set to excel for to save file.
Response.AddHeader("Content-Disposition", "attachment;filename=mm.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";

//write columns
string tab = "";
foreach (DataColumn dc in DT.Columns)
{
Response.Write(tab + dc.ColumnName);
tab = "\t";
}
Response.Write("\n");

//write rows
int i;
foreach (DataRow dr in DT.Rows)
{
tab = "";
for (i = 0; i < DT.Columns.Count; i++)
{
Response.Write(tab + dr.ToString());
tab = "\t";
}
Response.Write("\n");
}
Response.End();
}
}
}







 
When you say you display, you mean in Excel you are seeing that? Have you verified that font type is supported (available) in Excel? I would think that just exporting as straight text, it would not have an issue. Have you tried exporting to just a text file as well (maybe it is something with the "way" it is exporting)?

Rocco
 
I don't know the answer to the question; just an observation:

The Euro currency symbol is at Unicode codepoint U+20AC; it is represented in UTF-8 transformation format by the three byte string 0xE282AC.

If your application is UTF-8 enabled, I'd expect it to display this three byte string as the Euro currency symbol.

But if the application does not understand UTF-8, then it will almost certainly display the three bytes separately.

On Windows systems (in the western world) the default coded-character set is "Windows ANSI", also known as CodePage 1252; within this codepage, the above three bytes will display as follows:

0xE2 #LATIN SMALL LETTER A WITH CIRCUMFLEX
0x82 #SINGLE LOW-9 QUOTATION MARK
0xAC #NOT SIGN

i.e. as € (unless the Tek-Tips display mechansim mangles it).

And as for the character which DOES display as the Euro currency symbol in your sample: if you are using CodePage 1252, this symbol is mapped to 0x80 (you probably used Alt-Gr-4 to insert it, like this: €).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top