gamespy_query 0.2.0pre13 → 0.2.0pre14

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,7 +101,7 @@ STR
101
101
  number
102
102
  end
103
103
 
104
- STR_UTF8 = 'UTF-8'
104
+ STR_UTF8, STR_UTF16 = 'UTF-8', 'UTF-16'
105
105
 
106
106
  # Convert string to UTF-8, stripping out all invalid/undefined characters
107
107
  # @param [String] str String to convert
@@ -111,11 +111,11 @@ STR
111
111
  #else
112
112
  # str.encode(STR_UTF8, STR_UTF8, invalid: :replace, undef: :replace)
113
113
  #end
114
- alt ? str.encode(STR_UTF8, invalid: :replace, undef: :replace) : str.encode(STR_UTF8, STR_UTF8, invalid: :replace, undef: :replace)
114
+ alt ? str.encode(STR_UTF8, invalid: :replace, undef: :replace).encode(STR_UTF16, STR_UTF8, invalid: :replace, undef: :replace).encode(STR_UTF8, STR_UTF16) : str.encode(STR_UTF16, STR_UTF8, invalid: :replace, undef: :replace).encode(STR_UTF8, STR_UTF16)
115
115
  rescue nil, Exception => e
116
116
  # Fallback - convert to UTF and replace any invalid or undefined
117
117
  Tools.log_exception e
118
- str.encode(STR_UTF8, invalid: :replace, undef: :replace)
118
+ str.encode(STR_UTF8, invalid: :replace, undef: :replace).encode(STR_UTF16, STR_UTF8, invalid: :replace, undef: :replace).encode(STR_UTF8, STR_UTF16)
119
119
  end
120
120
  end
121
121
 
@@ -1,4 +1,4 @@
1
1
  module GamespyQuery
2
2
  # Version of the library
3
- VERSION = "0.2.0pre13"
3
+ VERSION = "0.2.0pre14"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamespy_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0pre13
4
+ version: 0.2.0pre14
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors: