Branch: Tag:

2009-09-09

2009-09-09 14:22:52 by Stephen R. van den Berg <srb@cuci.nl>

Instead of crashing, report non-UTF8 characters in a supposedly UTF8 object.

Rev: lib/modules/Sql.pmod/pgsql.pike:1.71

794:    case BPCHAROID:    case VARCHAROID:    value=_c.getstring(collen); -  if(cenc==UTF8CHARSET) -  value=utf8_to_string(value); +  if(cenc==UTF8CHARSET && catch(value=utf8_to_string(value))) +  ERROR("%O contains non-%s characters\n",value,UTF8CHARSET);    break;    case CHAROID:value=atext?_c.getstring(1):_c.getbyte();    break;