{"action":"closed","issue":{"url":"https://api.github.com/repos/pieroxy/lz-string/issues/60","labels_url":"https://api.github.com/repos/pieroxy/lz-string/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/pieroxy/lz-string/issues/60/comments","events_url":"https://api.github.com/repos/pieroxy/lz-string/issues/60/events","html_url":"https://github.com/pieroxy/lz-string/issues/60","id":97057447,"number":60,"title":"Safari breaks UTF-16 compressed strings when sending data through XMLHttpRequest","user":{"login":"carminexx","id":4161404,"avatar_url":"https://avatars.githubusercontent.com/u/4161404?v=3","gravatar_id":"","url":"https://api.github.com/users/carminexx","html_url":"https://github.com/carminexx","followers_url":"https://api.github.com/users/carminexx/followers","following_url":"https://api.github.com/users/carminexx/following{/other_user}","gists_url":"https://api.github.com/users/carminexx/gists{/gist_id}","starred_url":"https://api.github.com/users/carminexx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carminexx/subscriptions","organizations_url":"https://api.github.com/users/carminexx/orgs","repos_url":"https://api.github.com/users/carminexx/repos","events_url":"https://api.github.com/users/carminexx/events{/privacy}","received_events_url":"https://api.github.com/users/carminexx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-24T13:49:27Z","updated_at":"2015-08-28T17:50:46Z","closed_at":"2015-08-28T17:50:46Z","body":"I noticed a strange behavior when using LZString.compressToUTF16 (in JavaScript), sending the data (a compressed string) via XMLHttpRequest to a web server written in Java, and then using decompressFromUTF16 (I tried both proposed porting of LZString in Java).\r\n\r\nWhen I do all of this with Chrome or Firefox, everything works. Instead, when I use Safari, it sends the UTF16 string generated by LZString, but, when I decode the string on the Java web service, I got a null string.\r\nAfter a bit of debugging, I noticed that:\r\n1) The decompress algorithm fails at a specified character\r\n2) The sent UTF16 string (in Safari), and the received UTF16 string, on Java web service, differs for some characters.\r\n\r\nAre there issues in UTF16 encoding in Javascript for Safari, or it's a LZString limitation?"}}