Skip to content

Commit

Permalink
Slightly improve README to clarify issue with UTF16 and Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrondeau committed Apr 28, 2017
1 parent 03d23eb commit 9daf2ac
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
lz-string-csharp
================

C# Class implementation of LZ-String javascript

Based on the LZ-String javascript found here: http://pieroxy.net/blog/pages/lz-string/index.html
C# Class implementation of [lz-string](http://pieroxy.net/blog/pages/lz-string/index.html) (based on https://github.com/pieroxy/lz-string)


## Installation

- Add the NuGet package to your project: `Install-Package LZStringCSharp`

- Install with NuGet: `Install-Package LZStringCSharp`, or;
- Downloaded from the [Releases](https://github.com/jawa-the-hutt/lz-string-csharp/releases) page

## Please Note:

If you are using this in a web service and are sending in strings that are compressed by the Javascript version of LZ-String, then you will want to use the Javascript function `compressToUTF16`.
## Please Note

If you use just the regular Javascript `compress` function, then depending on the data in the string, it may not decompress correctly on the web service side. However, if you are using the `compress` function built into lz-string-csharp, then you should be ok to use the regular `decompress` function included.
If you plan on using this library for data sent by the browser (e.g. compressed in JavaScript in the browser, and sent to the server using HTTP), do *not* use `compressToUTF16` and `DecompressFromUTF16`. Safari will mangle up the data by converting to UTF-8, breaking the actual bytes of the request. Instead, you should use `compressToEncodedURIComponent` `DecompressFromEncodedURIComponent`.


## Contributors ##
## Contributors

lz-string-csharp was created by [jawa-the-hutt](https://github.com/jawa-the-hutt), with several necessary improvements made by [christianrondeau](https://github.com/christianrondeau)

0 comments on commit 9daf2ac

Please sign in to comment.