Skip to content

Commit

Permalink
note about 1.9.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Oct 29, 2013
1 parent 748de6c commit b91fc62
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ It supports HTML, URL, URI and Javascript escaping/unescaping.

## Installing

Compatible with Ruby 1.9.3+

``` sh
gem install escape_utils
```
Expand All @@ -18,20 +20,11 @@ gem install escape_utils

escape_utils assumes all input is encoded as valid UTF-8. If you are dealing with other encodings do your best to transcode the string into a UTF-8 byte stream before handing it to escape_utils.

On Ruby 1.9 this is as easy as:

``` ruby
utf8_string = non_utf8_string.encode('UTF-8')
```

If you're on Ruby 1.8 you can use [charlock_holmes](https://github.com/brianmario/charlock_holmes) to transcode like so:

``` ruby
# NOTE: we're assuming you know the encoding of `non_utf8_string` here.
# if you don't, you can use the detection API of charlock_holmes
utf8_string = CharlockHolmes::Converter.convert(non_utf8_string, other_encoding, 'UTF-8')
```

## Usage

### HTML
Expand Down

0 comments on commit b91fc62

Please sign in to comment.