Skip to content

Commit 04e4f24

Browse files
authored
Correct readme typos
1 parent 7a6413e commit 04e4f24

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
EncodedString is a wrapper for a string and a given encoding that handles operations on
44
strings with different encodings, invalid encodings, have no known conversion method,
5-
or are otherwise incompatible, all without raising excpetions
5+
or are otherwise incompatible, all without raising exceptions
66

77
## Installation
88

@@ -22,10 +22,16 @@ Or install it yourself as:
2222

2323
## Usage
2424

25+
Pick compatible encoding for two strings, if any:
26+
2527
```ruby
2628
EncodedString.pick_encoding(str1, str2)
29+
```
2730

28-
string = "123".force_encoding(EncodedString::UTF_8)
31+
Wrap a string and make it safely accomodate the target encoding:
32+
33+
```ruby
34+
string = "123".force_encoding(Encoding::UTF_8)
2935
str = "abc".encode('ASCII-8BIT')
3036
str = EncodedString.new(str, target_encoding = string.encoding)
3137
str.source_encoding.to_s

0 commit comments

Comments
 (0)