Generated function is more efficient than the implementation from wcwidth9 and also makes it easy to update when the unicode standard changes.