useful_string_extensions 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,4 +154,12 @@ class String
|
|
154
154
|
}
|
155
155
|
self == "" ? "" : Sanitize.clean(self, allowed_tags)
|
156
156
|
end
|
157
|
+
|
158
|
+
def encode_from_1251_to_utf8
|
159
|
+
self.force_encoding("windows-1251").encode("utf-8", :invalid => :replace)
|
160
|
+
end
|
161
|
+
|
162
|
+
def encode_to_utf8
|
163
|
+
self.encode("utf-8", :invalid => :replace)
|
164
|
+
end
|
157
165
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useful_string_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chardet
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.
|
99
|
+
rubygems_version: 1.8.23
|
100
100
|
signing_key:
|
101
101
|
specification_version: 3
|
102
102
|
summary: useful_string_extensions
|