[Gambas-user] Detecting a non-UTF character in a string

bbruen bbruen at ...2308...
Wed Mar 26 03:51:33 CET 2014


I get an occasional* error with downloaded data which results in a
postgresql update failure with the following error "ERR: Cannot create
record: ERROR:  invalid byte sequence for encoding "UTF8": 0xc2". I know
how to fix that as long as I can detect the bad char in the string. That
is what I dont know, in fact I haven't got the foggiest clue.

The input data is split out from a text file downloaded via FTP. The bad
data lines come from a particular source but only occur occasionally.
They always occur at the same "place" in the parsed file (i.e. a "Title"
field, which is a moderately lengthed string extracted using a Scan()
function.) They always appear at the same place in the field (i.e. at
the very end of the field.

So, how can I test if Right(sTitle,1) = NotARealCharacter?

tia
Bruce






More information about the User mailing list