Results 1 to 2 of 2
- 12-30-2008, 11:04 AM #1
Member
- Join Date
- Dec 2008
- Posts
- 2
- Rep Power
- 0
Problem while inserting UTF-8 characters in MS-SQL Server 2000 Database
Hi All ,
I have to insert an UTF-8 encoded string in database in MS SqlServer 2000
My application need to process spanish chracters, I get this in an XML string from the Flash Application,
e.g
if I have input string like "ю"
after UTF-8 encoding that gets converted into "Á ÝŽŸåã"
this string I need to insert in the databse in MS-SQLServer 2000
but after insertion this encoded string converts into "?????????????????????? ??????"
So when later I try to retrieve the string and decode it I get incorrect output.
please help me in finding solution.
- 12-30-2008, 04:39 PM #2
There are many 8-bit character sets in use. Your Flash application is passing you data in a specific set. Apparently, it is not UTF-8. It *might* be ISO 8859-1.
Java uses Unicode, which is a 16 bit character set. UTF-8 is essentially the first 256 Unicode characters.
1. Find out what character set (encoding) the Flash application is using. Until you know this for certain, you will have data corruption.
2. Determine if UTF-8 supports all the characters you are receiving. If not, you will have to modify the database or live with some data loss. SQL Server 2000 supports Unicode.
3. Use the proper Charset class to decode your input to a String, which will be in Unicode.
4. Normally, JDBC drives handle character set conversions. I suspect you are losing data when you first bring it into your Java program and convert it to a String.
Similar Threads
-
JSP Connecting to MS SQL SERVER 2000 using JDBC
By hisouka in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 09-02-2008, 09:23 AM -
Inserting data to database from the form
By Ms.Ranjan in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-17-2008, 01:06 AM -
Inserting string with slash character into database
By Java Tip in forum Java TipReplies: 0Last Post: 02-07-2008, 08:57 AM -
Inserting file in to database
By Java Tip in forum Java TipReplies: 0Last Post: 01-07-2008, 08:39 AM -
Help, conect a JSP, SQL SERVER 2000
By Marcus in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-06-2007, 03:04 PM


LinkBack URL
About LinkBacks

Bookmarks