javascript - Whats the right way to encode an umlaut in a dataURI -
i have small script let user save csv file using datauri. unfortunately there problems german umlauts, käufe become käufe. href datauri created this:
'data:application/csv;charset=utf-8,' + encodeuricomponent(csvstring)
it's not problem of encoding in url, of whoever interpreting data later not understanding it's encoded in utf-8 , interpreting in latin-1 instead. there no "right way" encode non-ascii characters in url. urls can consist of subset of ascii characters, period. else there's percent encoding method encode arbitrary bytes %xx format. encoding bytes represent entirely , entirely recipient interpret in correct encoding.
Comments
Post a Comment