CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    1

    Reading a column value in unicode in sql server side

    Hello,
    In our SQL Server 2008 database in extended property collation is set as SQL_Latin1_General_CP1_CI_AS'.
    I have a table, which contains string ported from text file having ASCII, UTF-8 formatted strings. Our requirement is that, we need to read value as Unicode from this table and then process that and fill other tables. We are not sure whether data present in ASCII, UNICODE or UTF-8/16.

    That' why we are looking for a procedure which can convert string to Unicode irrespective of encoding scheme.

    Suppose in a table i have data is utf-8 format for e.g.

    Carrer de Béjar

    Calle de Antonio Machado

    Calle del Canónigo Domenech

    Carrer de Pau ArpÃ* i GalÃ*

    Calle del Abad Oliba

    I want them to read in Unicode format, I have tried using Collate but could not succeed.
    Please share your solution.
    Regards,
    Sachin

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Reading a column value in unicode in sql server side

    Working with databases, you have to watch the data twice...once when you insert into the database, and when reading from it. It's possible that the data inserted was not properly decoded and therefore won't display correctly no matter what you do to read it.

    What are you using to iterate the database? Is this a custom app or are you just talking about SQL dumps?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Reading a column value in unicode in sql server side

    Quote Originally Posted by tosachingupta View Post
    I have a table, which contains string ported from text file having ASCII, UTF-8 formatted strings. Our requirement is that, we need to read value as Unicode from this table ...
    And what is the actual type(s) of data in this table?
    char, nchar, varchar, binary, ...?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured