Thread

  1. Special char problem, need help.

    Boulat Khakimov <boulat@inet-interactif.com> — 2001-04-04T15:17:55Z

    Hi,
    
        I have a string that is getting encoded using blowfish in postgres 
    (using my own function written in C for PG) and  storted in the
    database. 
    The problem is, that with some strings after encoding is done, I end up 
    with a special character in the middle of the encoded string that is  
    interprited  as the end of that string, so basically the result is 
    trunticated because of that. 
    Now the weird part is if I do length(col) where col is the field that 
    holds my encoded string,  it returns the real size, but if from C in my 
    decode function I do VARSIZE(string) it gives me the wrong (short) size.
    
    My question is, how do I get from C the real size of the string even if
    it has special character in it. Length(string) from postgres does it 
    somehow, and does it but VARSIZE(string) fails.
    
    
    
    Any feedback would be appreciated,
    Boulat.
    
    
    -- 
    Nothing Like the Sun