implement utility functions for utf-8