bsdconv() for MySQL