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!

Encoding from utf-8 to SQL Latin1 General CP1 CI AS

Status
Not open for further replies.

ac1982

Programmer
Jan 28, 2010
1
CY
hi,

I would like your help on the following matter. I have a JavaScript file currently reading from another site xml file in (utf-8) and I would like to store those data in my database which is in SQL_Latin1_General_CP1_CI_AS. Is there any function in JavaScript that can encode (convert) text from utf-8 to SQL_Latin1_General_CP1_CI_AS or any other way to do that?
 
Personally, I'd do this server-side with a call to "iconv". If you don't have access to that, you could use something similar to this PHP function:


You might even try to convert it into JavaScript if you absolutely must do this client-side.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top