Re: freebcp UTF8 to UCS-2LE importing

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Apart for a small rounding problem... committed to both 0.91 and CVS HEAD!

bye
  freddy77

2011/6/2 Will McQueen <[email protected]>:
> Here's the diff I applied to the 6/1 snapshot to fix the issue I
> was having loading UTF8 client data into nvarchar fields in SQL Server.
>
> @@ -1252,8 +1249,8 @@
>    */
>    file_len = collen;
>    if (bcpcol->char_conv) {
> -       if (bcpcol->on_server.column_size > bcpcol->column_size)
> -           collen = (collen * bcpcol->on_server.column_size) / bcpcol->column_size;
> +       if (bcpcol->char_conv->server_charset.max_bytes_per_char > bcpcol->char_conv->client_charset.min_bytes_per_char)
> +           collen = (collen * bcpcol->char_conv->server_charset.max_bytes_per_char) / bcpcol->char_conv->client_charset.min_bytes_per_char;
>        cd = bcpcol->char_conv->to_wire;
>        tdsdump_log(TDS_DBG_FUNC, "Adjusted collen is %d.\n", collen);
>
> Let me know what you think,
> Thanks,
> Will
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.