[MonetDB-users] mapilib latin1
Hi! I have a table with a varchar(100) column, when I connect to the server with mclient.bat -Elatin1 option I'm able to insert and display characters like ä and ö correctly. But I have problems to do the same with a c++ app and the mapilib. Does anyone have some hints? regards, Wilfried
On 2009-10-09 02:23, wilfried@hafner.ws wrote:
Hi!
I have a table with a varchar(100) column, when I connect to the server with mclient.bat -Elatin1 option I'm able to insert and display characters like ä and ö correctly. But I have problems to do the same with a c++ app and the mapilib. Does anyone have some hints?
Internally the server uses UTF-8. It does not accept latin1-encoded accented characters. mclient uses the iconv library to convert to and from UTF-8. So what happens is that when you type a latin1-encoded ä, mclient converts it to UTF-8 and sends that to the server, and when you select the table and display the result, mclient converts back from UTF-8 to latin1. The use of iconv is not built into the mapilib. It is done externally to the library in the mclient application. Your C++ application needs to do the same. -- Sjoerd Mullender
Zitat von Sjoerd Mullender
On 2009-10-09 02:23, wilfried@hafner.ws wrote:
Hi!
I have a table with a varchar(100) column, when I connect to the server with mclient.bat -Elatin1 option I'm able to insert and display characters like ä and ö correctly. But I have problems to do the same with a c++ app and the mapilib. Does anyone have some hints?
Internally the server uses UTF-8. It does not accept latin1-encoded accented characters. mclient uses the iconv library to convert to and from UTF-8. So what happens is that when you type a latin1-encoded ä, mclient converts it to UTF-8 and sends that to the server, and when you select the table and display the result, mclient converts back from UTF-8 to latin1.
The use of iconv is not built into the mapilib. It is done externally to the library in the mclient application.
Your C++ application needs to do the same.
Hi Sjoerd, thank you for your help! The problem was the different encoding of the mclient and my decoder, for example a latin1 ä results in 0xc284 when encoded by the iconv library, but the qt textcodec wants 0xc3a4... I have one last question with blobs, I try to insert/update a blob field with mapi_query_array, after calling there is an assertion failure in Mapi.mx on line 3373. I think the problem is due to some size limitations, when there are only a few bytes (for example '90ff' as parameter) it works fine, but for a picture with 3130 bytes it doesn't. regards, Wilfried
participants (2)
-
Sjoerd Mullender
-
wilfried@hafner.ws