From: Peter J. <pj...@wa...> - 2004-02-26 21:28:59
|
Hi Alessandro, All, "Alessandro Petrelli" <pet...@in...> wrote: > I have an unicode_fss db (I need to develop a Japanese application) and = an > asp.net DataGrid. All fields are shown correctly except those for which = I > call declarative databinding, for example: [...] > The field OUT_CHANNEL is return from a stored procedure and is a char(1)= . I > should expect values like 'P' or 'E', but instead they are returned as '= P ' > or 'E '. The sad fact is, that this field will also happily hold 'PPP' and 'EEE' or= 'P=D6' but not '=D6=D6', if you see what is going on here. (Perhaps the NE= T provider actually manages to forbid these INSERTs, but with the C API or ISQL it's possible.) Now, at SELECT time, a clever middle layer (like the NET provider ;-) ), can try to make the situation more sane. Knowing that a 3 byte buffer for UNICODE_FSS should better only hold one character, it can algorithmically extract just one UTF-8 character from the buffer, ignoring the junk bytes after that. Regards, Peter Jacobi |
From:
<car...@te...> - 2004-02-26 23:12:13
|
Hello: > Now, at SELECT time, a clever middle layer (like the NET provider ;-) ), > can try to make the situation more sane. Knowing that a 3 byte buffer for > UNICODE_FSS should better only hold one character, it can algorithmically > extract just one UTF-8 character from the buffer, ignoring the junk bytes > after that. Yes :) the only problem is how to deal with querys against system tables ( maybe i will be checking that the field name and the table name starts with RDB$ ). -- Best Regards Carlos Guzmán Álvarez Vigo-Spain |
From: Peter J. <pj...@wa...> - 2004-02-27 08:05:03
|
Hi Carlos, All, > the only problem is how to deal with querys against system tables ( > maybe i will be checking that the field name and the table name starts with > RDB$ ). I've already fiven my disclaimer that I've lost (if I ever had) the overview. But... Aren't the system table columns the only UNICODE_FSS columns with length in (in bytes) which isn't divisable by three? Thinking of it, this test isn't really better than testing for RDB$, only want to bring it up. Regards, Peter Jacobi |
From:
<car...@te...> - 2004-02-27 10:14:32
|
Hello: > Aren't the system table columns the only UNICODE_FSS columns with length in > (in bytes) which isn't divisable by three? Known by me yes :) > Thinking of it, this test isn't really better than testing for RDB$, only > want to bring it up. I'm sorry, i don't understand this, can you explain in another way, please :) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: Peter J. <pj...@wa...> - 2004-02-27 10:30:15
|
Hi Carlos, > > Aren't the system table columns the only UNICODE_FSS columns with length > > in (in bytes) which isn't divisable by three? > > Known by me yes :) > > > Thinking of it, this test isn't really better than testing for RDB$, only > > want to bring it up. > > I'm sorry, i don't understand this, can you explain in another way, > please :) The rather hackish idea is: // Incoming data: n bytes of UNICODE_FSS If (n % 3 == 0) { // extract n/3 UTF-8 characters into destination buffer } else { // copy n bytes into destination buffer } Regards, Peter Jacobi |
From:
<car...@te...> - 2004-02-27 10:35:58
|
Hello: > // Incoming data: n bytes of UNICODE_FSS > If (n % 3 == 0) { > // extract n/3 UTF-8 characters into destination buffer > } else { > // copy n bytes into destination buffer > } Huummm i will test it later today and post the result, thanks very much :) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: Alessandro P. <pet...@in...> - 2004-02-27 16:47:45
|
"Carlos Guzmán Álvarez" <car...@te...> ha scritto nel messaggio news:403...@te...... > > Huummm i will test it later today and post the result, thanks very much :) > I tested latest cvs source, now varchar are correctly retrieved but char no... any idea? Ciao, Alessandro Petrelli. |
From: <car...@te...> - 2004-02-27 17:38:52
|
Hello: > I tested latest cvs source, now varchar are correctly retrieved but char > no... any idea? Because now varchar fields are readed/written trimmed, but char fields no ;) , i have implemented the solution proposed by Peter Jacobi only in 1.6 sources in my local tree. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From:
<car...@te...> - 2004-02-27 17:39:05
|
Hello: > I tested latest cvs source, now varchar are correctly retrieved but char > no... any idea? Because now varchar fields are readed/written trimmed, but char fields no ;) , i have implemented the solution proposed by Peter Jacobi only in 1.6 sources in my local tree. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: Alessandro P. <pet...@in...> - 2004-02-27 09:21:21
|
""Peter Jacobi"" <pj...@wa...> ha scritto nel messaggio news:403E73F2.11159.130DA2D@localhost... > The sad fact is, that this field will also happily hold 'PPP' and 'EEE' or= > > 'P=D6' but not '=D6=D6', if you see what is going on here. (Perhaps the NE= > T > provider actually manages to forbid these INSERTs, but with the C API or > ISQL it's possible.) > Yes, you're right, all char fields are not trimmed out... Ciao, Alessandro Petrelli. |