On 18/04/2017 12:38, Jiří Činčura wrote: > Hmm. That explains a lot of issues I was trying to push through today > with CHARs. I.e. was getting 80 bytes buffer where was 20 characters > and 60 spaces, because the characters were all 1B. > > It's pretty sad, actually. > > So my best chance is probably to trim to length/4 and hope for the best. > > Jiri, what you said (change SQL_TEXT to SQL_VARYING) and what I show you (fixMetadata function) just fix this problem.
Change it and forget. You'll always read SQL_VARYING and have the actual length in the first two bytes. The problem is not with CHAR data type, only its representation with SQL_TEXT. This change from SQL_TEXT->SQL_VARYING will not work only in some old versions (maybe firsts 2.1.x or 2.0.x). Adriano ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel