Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp UTF8 to UCS-2LE importing

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Will McQueen <wmcqueen AT athenahealth.com>
  • To: "freetds AT lists.ibiblio.org" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp UTF8 to UCS-2LE importing
  • Date: Thu, 2 Jun 2011 09:58:53 -0400

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




Archive powered by MHonArc 2.6.24.

Top of Page