Menu

Unicode Support?

2002-03-08
2002-03-11
  • Dave Griffin

    Dave Griffin - 2002-03-08

    I'm a little confused by the Unicode support that is claimed to be in TclODBC. 

    TclODBC has the ability to set the encoding to the database, but true Unicode support seems to not be there (or I'm missing how it works).

    In particular, I'm currently working with SQL Server (Oracle is next, but one thing at a time) - and while SQLServer 7 has support for Unicode characters (NCHAR, NVARCHAR, etc.) the TclODBC interface doesn't seem to recognize this.

    There is a note in the TclODBC docs that says "In tcl 8.1 strings are stored in unicode form, but ODBC API uses only old-fashioned 8-bit character strings." -- but as of ODBC V3, my understanding is that Unicode values are also supported.

    My impression, so far, is that TclODBC takes whatever encoding is set for the database and treats all data (including the queries themselves) as being in that character set - even if the datatype of the column stores unicode.

    I'm happy to provide examples of what I'm badly expressing in the preceding paragraphs, if that would help.

    How are people managing Unicode data via TclODBC?

    Thanks,

    - dave

    (p.s. I'll take the results of this discussion an turn it to a TclWiki article)

     
    • Roy Nurmi

      Roy Nurmi - 2002-03-09

      Your interpretation is correct. Tclodbc is based on ODBC 2.0, which did not have any multi-byte datatypes, but with witch everything was stored in 8-bit characters in some character set.

      The "unicode support" means just the ability to convert between tcl UTF-8 reprentation to any 8-bit character set known by tcl encodings. Tclodbc does not support multi-byte character sets.

      The true multi-byte unicode support may be there some day, but currently I have no need for such myself. So, if someone wants to contribute code to enable multibyte processing in tclodbc, I'll be happy to take it to general version as well.

      -- Roy Nurmi

       
    • Dave Griffin

      Dave Griffin - 2002-03-11

      Hi Roy,

      Thank you for the clarification.

      - dave

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.