Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everybody

I have a translation problem (btw, please excuse my poor english i will do my best to be understandable).
I have a label on a page, which the value is filled via javascript. On postBack of the page, i fill a field on my database (sql server) with the value of this label, for being used on another page and in an e-mail.

I would say that so far, so good.

But when the web-user used an add-on like automatic ChromeTranslation for reading the page, my label can contains cyrilics (or chineses, or what you want) characters. So, my db table, which only knows latins characters, contains some "????" and some "????".

I can see a solution by refactoring my server side code, but before i get out my hammer and screwdriver, i would like to know if anyone has a genious idea for rewriting the value of my label on client side, or just to disable the translation of this specific label.

Thanks in advance,
Posted
Comments
Corporal Agarn 28-Mar-12 12:29pm    
I am making this a comment as I have no idea of how to answer.
Could you use an IMAGE data type to store the data? Change the collation of the column?

Refactoring the server side should not be so complicated. Change the datatype of the column from varchar to nvarchar. .Net applications handle unicode strings, so I think that that small change in the column definition should do it.
 
Share this answer
 
Hello Bernhard

Thanks, it worked. I changed the datatype to nvarchar, and the field admit cyrillics chars. You made me understand the difference between varchar and nvarchar.
It seem i need also prefix with 'N' the value in my insert query. For exemple :
"insert into table (field) values (N'УНИКАЛЬНЫЙ')"

--> as i change my request i need to update server side code, so i'll take opportunity to change the way i store this data.

Before i do that, and for going fast without re-publishing my project, i just converted curillics characters into latins ones, via javascript (script of this site). Dirty solution, i know, because yiddish or japaneses characters are not yet managed. But it work now for russians people, that's ok, thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900