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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A text box that doesn' t accept/understand '€' symbol

Status
Not open for further replies.

cesark

Programmer
Dec 20, 2003
621
Hi,

I have a text box in a web form, and when I type '€' symbol and I press submit button, instead of sending that sybmol it sends '?'. How can I solve this problem?

Thank you,
Cesar
 
I have to use HTMLEncode? But, other signs as ($,%,&,#,..) are inserted correctly in the database.. Why not this?: €.
It' s a normal currency symbol like $...
 
because the list of signs you mentioned are all standard and the other sign with which you are facing problems is not standard..may be i think it belongs in the set of extended ascii codes...


-DNG
 
And then, which can be the solution? I don' t know what can I do with those ascii codes :)
 
you can do a replace function...

for example...

Replace(yourtextboxname,chr(36),"")

here we are replacing $ sign with an empty space...chr(36) is the code for $ sign

did you try htmlencode()??


-DNG
 
Yes, I tried:
Code:
CmdInsert.Parameters("@Reference").Value = Server.HtmlEncode(ref.Text())

But it does the same, ? is inserted instead of €.

I don' t know which is the code for € to try 'Replace(ref,chr(36),"")'
 
did you try just this:

Replace(ref,"€","$$")

just some other character...yeah i dont even see the ascii code for that sign

-DNG
 
Yes, it replaces € by $$, and the last one is inserted in the database ($$) when I type € in the text box. But how can I achieve insert € sign? Anyway, if achieve it, I will have to do the same in all the text boxes in my website so that the users can type that sign if necessary?

 
try this...

Replace(ref, "€",chr(8364))

ascii code for € is 8364

if it doesnt work..i am out of suggestions..
-DNG
 
With your last suggestion is inserted '€' in the database instead of € sign. To see the inserted '€' as '€' in the web page (when retrieving data) I would simply apply 'Server.HtmlDecode(CmdRetrieve.Parameters("@Reference").Value)', but I tried it and the web page continue displaying '?' instead, when in the database there is '€'. The same happens when I type '€' directly in the DB (the web page displays '?'). Perhaps it's a brower problem or ADO..

 
no problem...glad to help...sorry that couldnt provide the complete solution...

-DNG
 
How are you querying the database? The default font for Query Analyzer doesn't do non-ANSI characters. You should go into it's options and set the font to something like MS Arial Unicode to make sure the tool isn't lying to you.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi chiph,

I don' t understand your suggestion.. Do you mean change the font of Query Analyzer?? If I insert directly/manually (in Query Analyzer) the € sign in a column of the table it works fine, the € sign is inserted. The problem is when I retrieve this value from the application or vice versa (when inserting the value from the application to the DB).
 
I already solved the problem, it was a web.config issue. In the globalization section of that file:

I had:
Code:
      <globalization 
	   fileEncoding="iso-8859-1"
           requestEncoding="iso-8859-1"
           responseEncoding="iso-8859-1"
           culture="es-ES" />

And it must be:
Code:
      <globalization 
	   fileEncoding="iso-8859-[b]15[/b]"
           requestEncoding="iso-8859-[b]15[/b]"
           responseEncoding="iso-8859-[b]15[/b]"
           culture="es-ES" />

The explanation is here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top