Topic: SQL again - encoding

Anybody have any suggestions as to what might be the best way to work around this? A varchar column, PgSQL db with UTF8 encoding, and getting this error from a specific string:

ERROR:  22021: invalid byte sequence for encoding "UTF8": 0xf5beb5ad

Am I going to have to use something along the lines of the mb_ functions to convert it before insertion/query, or is there a more suitable type to use for the column?


Cheers again. smile

Re: SQL again - encoding

http://www.postgresqlforums.com/forums/ … &t=289

Re: SQL again - encoding

They do know how to make things awkward, don't they. big_smile That would be pretty much defeating the point of using utf-8, would it not?

Been trying it with an alternate, (and probably not the best option, granted), method over the last several hours to work around it, (and it hasn't glitched yet), of base64 encoding the key before it's inserted. Seems to be doing the trick so far. Phaffy method, I know, but the best one I could think of at the time. big_smile