Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS couldn't convert data row's from CP1251 to UTF-8, but field's name is converted

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: jklowden AT schemamania.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS couldn't convert data row's from CP1251 to UTF-8, but field's name is converted
  • Date: Wed, 20 Oct 2010 10:52:47 -0400

On Wed, Oct 20, 2010 at 06:38:41PM +0600, ?????? ???????? wrote:
> --Table: dbo.adres
>
> CREATE TABLE dbo.adres (
> [Column 0] varchar(50),
> [????????? ?????] varchar(50),
...
> [Column 25] varchar(50)
> )
> GO
>
> query: select top 5 * from adres
>
> Problem: FreeTDS couldn't convert data row's from CP1251 to UTF-8, but
> field's name is converted.
>
> Platform: Win32

Yes, it's a problem. I'm not sure what to suggest.

On Win32, FreeTDS uses its built-in iconv to convert to the local character
set. The built-in iconv recognizes UCS-2, which is the encoding used for
column names. It does not recognize CP1251.

Choices:

1. CAST/CONVERT data to NVARCHAR on the server. The client will see UCS-2
data and convert as above.

2. Build GNU or other iconv library on Win32, link it with FreeTDS. Once
you have the names straightened out, it should Just Work.

3. Use Win32 native functions to convert the data post-binding. Might not
work so well if the built-in iconv already attempted a conversion.

4. Extend built-in iconv for CP1251. Might actually be easiest.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page