January 3, 2006 at 1:31 am
Hi,
I have a problem inserting the character '€' in the database.
The character '€' gets converted into '?' in the database.
The problem remains even when I enter this character in the data window in sql server.
Is there any solution to this?
Please help.
Regards,
brlele
January 4, 2006 at 3:57 am
The collation that you are using probably does not support the Euro sign. However, are you sure that it is not just the client you are using that does not show the data correctly?
January 4, 2006 at 8:04 am
If you're seeing a question mark, my guess is that it is not just a code page issue. The character is probably being converted either before insertion or on display. The euro character can be entered as ALT-128 in code page 1252 which works for most Windows software. If it is displayed under the old DOS code page 437 it will be an upper-case C-cedille. I don't know of a code page that would show char(128) as a question mark, but there are many systems that will assume only chars 32-126 are displayable and will substitute a question mark.
This character < Ç > was entered with ALT-128 and should be the euro but it is showing up as a C-cedille in this input box. I'll be interested in seeing how it is displayed after this is posted.
Edit: The C-cedille did not magically become a euro after posting, but I can enter it < € > if I switch to HTML mode and use ampersand-pound-8364;. Which just proves that working with these characters can be tricky. This web site has some related information, including advice not to use ALT-128: http://www.cs.tut.fi/~jkorpela/html/euro.html
January 4, 2006 at 9:36 am
If you wanted to prove whether this conversion in taking place in the database or in the client software, use profiler to see exactly what is being inserted.
Another question is how are you storing this character in the database? If you're using char or varchar, you need to look into the collation and make sure it supports the euro. If it is nchar or nvarchar and you're using the correct Unicode character value, it will be stored correctly in the database if it hasn't been altered by the data entry program. How it is displayed by the client is another issue.
The command "print nchar(8364)" should display a euro independently of the collation or code page (if my understanding of Unicode is correct).
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply