Skip to Content.
Sympa Menu

freetds - [freetds] freebcp patch for charset

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] freebcp patch for charset
  • Date: Mon, 20 Jul 2009 11:43:03 +0200

Does this patch seems resonable ??

Index: freetds83/src/apps/freebcp.c
===================================================================
--- freetds83.orig/src/apps/freebcp.c 2009-07-20 11:39:07.500572628 +0200
+++ freetds83/src/apps/freebcp.c 2009-07-20 11:41:14.216542571 +0200
@@ -192,7 +192,7 @@
* Get the rest of the arguments
*/
optind = 4; /* start processing options after table,
direction, & filename */
- while ((ch = getopt(argc, argv,
"m:f:e:F:L:b:t:r:U:P:I:S:h:T:A:O:0:ncEdvV")) != -1) {
+ while ((ch = getopt(argc, argv,
"m:f:e:F:L:b:t:r:U:P:I:S:h:T:A:O:0:C:ncEdvV")) != -1) {
switch (ch) {
case 'v':
case 'V':
@@ -287,6 +287,9 @@
pdata->Aflag++;
pdata->packetsize = atoi(optarg);
break;
+ case 'C':
+ pdata->charset = strdup(optarg);
+ break;
case '?':
default:
pusage();
@@ -361,6 +364,8 @@
DBSETLUSER(login, pdata->user);
DBSETLPWD(login, pdata->pass);
DBSETLAPP(login, "FreeBCP");
+ if (pdata->charset)
+ DBSETLCHARSET(login, pdata->charset);

/* if packet size specified, set in login record */

@@ -373,7 +378,7 @@
BCP_SETL(login, TRUE);

/*
- * ** Get a connection to the database.
+ * Get a connection to the database.
*/

if ((*pdbproc = dbopen(login, pdata->server)) == NULL) {
Index: freetds83/src/apps/freebcp.h
===================================================================
--- freetds83.orig/src/apps/freebcp.h 2009-07-20 11:39:07.512540700 +0200
+++ freetds83/src/apps/freebcp.h 2009-07-20 11:41:14.216542571 +0200
@@ -51,6 +51,7 @@
char *server;
char *hint;
char *options;
+ char *charset;
int packetsize;
int mflag;
int fflag;


I don't know if proprietary library has an option for this

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page