Skip to Content.
Sympa Menu

freetds - Re: [freetds] Mac OSX FreeTDS 0.8.3dev Unexpected EOF from the server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Luciano Pacheco <lucmult AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Mac OSX FreeTDS 0.8.3dev Unexpected EOF from the server
  • Date: Fri, 7 May 2010 12:13:31 -0300

On Fri, May 7, 2010 at 10:58 AM, Craig A. Berry <craigberry AT mac.com> wrote:

>
> On May 6, 2010, at 11:48 PM, Luciano Pacheco wrote:
>
> > Hi,
> >
> > I'm trying connect from Mac OSX Leopard with FreeTDS to a MSSQL 2000
> > MSDE,
> > and I'm getting this error:
> >
> > [01:40:09] $ /usr/local/bin/tsql -S MACLUCK -I
> > /opt/local/etc/freetds/freetds.conf -U lucianopacheco -D
> > dbServicos -P
> > <password snipped>
> > locale is "pt_BR.utf-8"
> > locale charset is "utf-8"
>
> I think that's your problem right there. How is this locale set? Do
> you have LANG in your environment? What do you get from:
>
> % locale -a | grep pt_BR
> pt_BR
> pt_BR.ISO8859-1
> pt_BR.UTF-8
>

The same output.

(that's what I see on my Leopard system). If yours is anything like
> mine, pt_BR.UTF-8 is a valid locale setting, but pt_BR.utf-8 is not.
>

I did:
$ export LANG=pt_BR.UTF-8
$ export LC_COLLATE=pt_BR.UTF-8
$ export LC_CTYPE=pt_BR.UTF-8
$ export LC_MESSAGES=pt_BR.UTF-8
$ export LC_MONETARY=pt_BR.UTF-8
$ export LC_NUMERIC=pt_BR.UTF-8
$ export LC_TIME=pt_BR.UTF-8

$ set |grep -i utf
LANG=pt_BR.UTF-8
LC_COLLATE=pt_BR.UTF-8
LC_CTYPE=pt_BR.UTF-8
LC_MESSAGES=pt_BR.UTF-8
LC_MONETARY=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8

How can I setup this in OSX ? .bash_profile ?

> 01:45:08.194206 76313 (iconv.c:364):setting up conversions for client
> > charset "utf-8"
> > 01:45:08.194215 76313 (iconv.c:366):preparing iconv for "utf-8" <->
> > "UCS-2LE" conversion
> > 01:45:08.194237 76313 (iconv.c:442):tds_iconv_info_init: client
> > charset name
> > "" unrecognized
>
> FreeTDS knows what to do with UTF-8 (upper case) but not (utf-8) lower
> case.
>

Now works! :-)

11:20:01.979689 740 (iconv.c:364):setting up conversions for client charset
"UTF-8"
11:20:01.979698 740 (iconv.c:366):preparing iconv for "UTF-8" <-> "UCS-2LE"
conversion
11:20:01.979723 740 (iconv.c:407):preparing iconv for "ISO-8859-1" <->
"UCS-2LE" conversion
11:20:01.979745 740 (iconv.c:410):tds_iconv_open: done

Maybe FreeTDS can fail more gracefuly when this happen, because the error
reported on command line is far from helpful. What do you think about it ?


> > What else can I try ?
>
> Try fisql or see my tsql.c patch in the archives from a week or so
> ago. There's still a bug or two that need to be fixed regarding
> overriding the system default character set, but getting yourself into
> a position where you don't need an override is probably your best bet.
>

Here is the patch:
https://lists.ibiblio.org/sympa/arc/freetds/attachments/20100430/244dd8a5/attachment.obj

I will try the patch with more time.

I read the patch and don't understand why use ISO-8859-1 as default
encoding, AFAIK the best choice today is use the UTF-8, that can handle more
use cases, but I'm very new to freetds.

Thanks by your fast feedback! :-)
--
Luciano Pacheco
blog.lucmult.com.br




Archive powered by MHonArc 2.6.24.

Top of Page