JDBC and UTF-8

  • While trying to retrieve data from SQL server 2000 table using JDBC, some character values are getting converted - especially characters with ASCII value 129, 141, 143, 144, 157 are retrieved with different values. For instance, the character with ASCII value 129 is retrieved as ascii value 63. Is there any workaround for this?

    JDBC Type 4 driver from Microsoft is used for data access. The data type for the concerned column is varchar.

    One recommended solution is to use the getBytes() function to retrieve the data after casting it to VarBinary - this is not helping us as we cannot change the stored procedure which accesses the actual table data. (Third party owned).

    Please help.

    Thanks in advance

  • You are getting character conversion because those are not ASCII but actually Unicode, which means you do ANSI SQL ALTER to change Varchar to NVarchar and you have to do column level collation for the langauge to include ascent sensitive collation.  Try the links below for SQL Server collation chart.   Post again if the problem continues but based on the values to ASCII 129, 141, 143, 144 and 157 at the ASCII lookup table site ascent sensitive collation will fix your problem.   Hope this helps.

    http://msdn2.microsoft.com/en-us/library/ms143508.aspx

    http://msdn2.microsoft.com/en-us/library/ms180175(SQL.90).aspx

    Kind regards,

    Gift Peddie

    Kind regards,
    Gift Peddie

  • Thanks a lot for your response. Will try it out and let you know the outcome.

    thanks and regards

    Anitha

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply