[unixODBC-support] what to do about unicode?

Nick Gorham nick.gorham at easysoft.com
Thu May 29 09:52:12 BST 2008


support wrote:

>Nick Gorham wrote:
>  
>
>>support wrote:
>>
>>    
>>
>>>>Ok. I was planning a thin wrapper around the odbc calls anyway. I can
>>>>put the wchar_t <--> utf16 conversion in there. I don't even know that
>>>>unicode in the database is really necessary, but the UI will be unicode
>>>>so I might as well be doing odbc unicode to UI unicode conversions
>>>>instead of odbc ascii to UI unicode.
>>>>
>>>>-john
>>>>_______________________________________________
>>>>
>>>>
>>>>  
>>>>        
>>>>
>>If you get the chance to make a list of the functions you use, it may
>>be worth us thinking about creating a helper library of such functions.
>>
>>    
>>
>I just made a light c++ class to encapsulate SQLWCHAR strings.
>It can be constructed from a std::wstring (and therefore a wchar_t string).
>It has a static member function that can take a SQLWCHAR string and
>return std::wstring.
>It has a SQLWCHAR * operator overload so it can be passed directly to
>ODBC calls.
>
>On Linux iconv() is used for WCHAR_T <-> UTF16 conversions.
>On windows it just internally stores a std::wstring reference, no
>conversion is done.
>
>I think that will cover my needs. At least so far. If interested I can
>make the code available.
>
>-john
>
>_______________________________________________
>unixODBC-support mailing list
>unixODBC-support at easysoft.com
>http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>
>
>  
>
Its things like that that C++ does make much simpiler :-)

-- 
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org




More information about the unixODBC-support mailing list