Subject | Re: [firebird-support] UTF8 problem with FB 2.1.3 |
---|---|
Author | Paul Vinkenoog |
Post date | 2011-01-05T22:29:24Z |
Markush wrote:
Try
insert into fdb_categories(categorykey, categoryname, parentcategorykey) values(2, _iso8859_1 'Gemüse', 1);
This usually works for me. ISO8859_1 is a single-byte set. When this arrives at the server *and* the server is told that it's ISO8859_1, it has no trouble converting it to UTF8. (And if it *does* have trouble, you can use an explicit cast.)
Probably "set names iso8859_1" would also work, or "set names win1252". Then you won't have to use the introducer syntax every time you insert a non-ASCII character.
HTH,
Paul Vinkenoog
> When I try to insert a row with a categoryname which has german umlauts it doesn't work. Neither from ibExpert nor from ISQL:"Set names UTF8" is only a signal to Firebird; it doesn't force Windows to convert your keystrokes to UTF8.
>
> SQL> set names UTF8;
> SQL> insert into fdb_categories(categorykey, categoryname, parentcategorykey) values(2, 'Gemüse', 1);
> Statement failed, SQLCODE = -104
> Malformed string
> SQL>
>
> Insertion of 'Gemuese' works though, so it seems to be a charset related problem.
Try
insert into fdb_categories(categorykey, categoryname, parentcategorykey) values(2, _iso8859_1 'Gemüse', 1);
This usually works for me. ISO8859_1 is a single-byte set. When this arrives at the server *and* the server is told that it's ISO8859_1, it has no trouble converting it to UTF8. (And if it *does* have trouble, you can use an explicit cast.)
Probably "set names iso8859_1" would also work, or "set names win1252". Then you won't have to use the introducer syntax every time you insert a non-ASCII character.
HTH,
Paul Vinkenoog