fix btoa for non-latin characters