Results 1 to 2 of 2

Thread: Need some hints for dealing with MS ODBC driver and utf8 data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Need some hints for dealing with MS ODBC driver and utf8 data

    Hello!

    I need to fill some MS SQL Server (2008) with data containing UTF8 characters. For example german umlauts, but also a lot of other characters. Any 8-bit codepage is not an option :-(

    So far everything works fine as long as the data I fill into the database (and read form it) are 7 bit chars. Somehow I do not find those pages which help me to isolate the problem.

    Question:
    Do I need to add some string like "CHARSET=utf8" when opening the connection?
    Do I need to set the charset later when I open a specific database (with the USE <database> statement) and how?
    Do I nee those database types nchar and ntext/nvarchar or does it work with char and text/varchar?

    Anything else?

  2. #2
    Join Date
    Apr 2006
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need some hints for dealing with MS ODBC driver and utf8 data

    Found the problem.

    A statement like "INSERT INTO xxTest (x_nchar) VALUES ('Gülle')" corrupts that Umlaut, whereas "INSERT INTO xxTest (x_nchar) VALUES (:nch)" and bind that string "Gülle" to nch works fine.

Similar Threads

  1. Deploying QT App using ODBC driver
    By AlphaWolfXV in forum Installation and Deployment
    Replies: 7
    Last Post: 5th December 2014, 13:19
  2. ODBC driver error QODBCResult::data: column out of range
    By Andrewgaven in forum Qt Programming
    Replies: 6
    Last Post: 16th January 2013, 09:30
  3. Read blob fields from a database with the odbc driver
    By Andrewgaven in forum Qt Programming
    Replies: 0
    Last Post: 14th January 2013, 02:40
  4. Slow ODBC driver or programming error?
    By TorAn in forum Qt Programming
    Replies: 9
    Last Post: 13th November 2011, 22:31
  5. source code for odbc driver or MySql driver in arm-embedded-linux
    By sattu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th January 2011, 10:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.