Subject Re: [firebird-support] utf8 and isql script
Author Helen Borrie
At 10:22 AM 19/12/2009, Peter Lee wrote:

>> If the former, I'm afraid that it sounds like IBExpert is reading Qt's
>> unicode characters and (probably) writing a file in a normal 8 bit
>> character set.
>> If the latter, then isql is unable to read the unicode.
>IBExpert shows the strings in two ways - unicode and plain text. When
>the database is updated via Qt code, unicode looks like this: più and
>plain text looks like this: più - which is fine.
>However - regardless of which version I place in my sql script for
>processing through isql - I end up with incorrect values. I have a SET
>NAMES UTF8; at the start of my script - which seems to work if I have
>this string; 'più', but not this 'più'.

SET NAMES tells the client to expect UTF-8 characters in the input. Consider the following:

1. If the input is in some other character set, then the only characters that will be "correct" (from your point of view) are the ones that are 7-bit characters in single-byte charsets, since they are common to all character sets, including UTF-8. Let's refer to these characters as "the common characters" for our purposes here.

2. You will have the same problem with metadata object names if they include
characters that are NOT common characters and those object names are not double-quoted.

You are not saying how you created these scripts, either. If IBExpert has some utility for creating scripts then it is not very likely that those scripts would be in UTF-8, since IBE is written in Delphi and Delphi does not support UTF-8.

It's possible you need to encode your scripts before passing them into isql. You might like to look at Notepad++ (Google for it), a free editor for Windows that can encode UTF-16 and ansi text as UTF-8.

Discovering the exact cause of your problem looks like an issue for IBExpert's user list, though; or you could ask about it in Firebird-tools.

^ heLen ^