Subject Re: Special Character Problems (Trademark Symbol)
Author mbellisle_retire
--- In firebird-support@yahoogroups.com, "peter_jacobi.rm"
<peter_jacobi@g...> wrote:
> Hi Mark,
>
> --- In firebird-support@yahoogroups.com, "mbellisle_retire" wrote:
> > I'm having a problem with getting data out of an IB db using
Free
> > IBProvider odbc driver.
>
> I can't help you with the odbc driver, but if it works
> correctly, everything should fit together after you
> solved the underlying character set problem.
>
> > The problem is, some of the IB data contains the trademark
symbol
> > (™), and it's causing an error.
>
> So let's try to debug with the old but trustworthy ISQL console.
>
> Open a console window (you are on a NT+ system?)
>
> Set the console's codepage to 1252 with:
> chcp 1252
>
> Start ISQL and set the connection char set to CP1252:
> SQL> set names WIN1252;
>
> Open your database, select the offending field:
> SQL> select FLD from TBL where COND;
>
> Now, I assume ISQL gives:
> > Cannot transliterate character between character sets
>
> Select using explicit cast (match your field length)
> SQL> select cast (FLD as varchar(200) character set WIN1252);
>
> Does that work and display the TM-Symbol?
>
> O.K. "Dangerous Bend" sign ahead - do you have a backup?
>
> Safe way: add a new column with character set WIN1252
> and copy the data to the new column, using the cast
> shown above
>
> Hack: Change the metadata of the existing column, setting
> character set ID to 53
>
> After either of these surgeries, you should now be able
> to get the TM-sign in ISQL without cast.
>
> Now your ODBC access should work too, using WIN1252 as
> connection character set.
>
> Regards,
> Peter Jacobi

Thanks for the help Peter,
I didn't get the results you've described.

Firstly, I now realize I was a bit sparse with details, my apologies:

OS: Win XP Pro(NT 5.1) SP1
(yes indead, part of the M$ swiss cheese revolution to
computer security, but becoming more bewildered by the day)

IB: WI-V6.0.1.0 (from IBConsol)
Open source version from Borland's site.

IBConsole ver 1.0.0.326

Query:
select name from formula
where name like "%FEM™%"


Ok, I've done some playing and now I'm reallllllly confused.


I did some playing with IBConsole and how you register the db. I
used all the versions of the Win125x character sets and all of them
give me errors when I do the query from Interactive SQL in
IBConsole. When I register using 'none' or just leave it empty, the
query works, but it returns a different character in the resutls
window for the query.

Ah Viola!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I must have just woke up. The problem is that I'm using the WIN125x
character set. It finally sank in when I could produce the same
error in the IBConsole that I was getting through ADO connection
when I used a specified char set. When I leave it blank in the ADO
connection string, it works fine.

Thanks very much everyone for the help.
Mark