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
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.