Skip to main content

How can I determine if data consists of valid utf-8 characters?

  • February 15, 2013
  • 1 reply
  • 4 views

Forum|alt.badge.img+2
How can I determine if data consists of valid utf-8 characters? What causes this: " ERROR: regexp pattern error at offset 25: invalid UTF-8 string"?

1 reply

Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • February 15, 2013
As of version 4.1.6 and later, the isutf8() function can be used for determining if string consist of valid UTF-8 characters. This function tests whether a string is a valid UTF-8 string. Returns true if the string conforms to UTF-8 standards, and false otherwise. Best practice is to avoid loading non UTF-8 data into the database.