lib/pagseguro/base.rb in pagseguro-0.1.7.beta.0 vs lib/pagseguro/base.rb in pagseguro-0.1.7.beta.1
- old
+ new
@@ -48,8 +48,22 @@
# Reader for the `developer` configuration
def developer?
config? && config["developer"] == true
end
+ # Detect if current encoding is UTF-8
+ def utf8?
+ encoding == "UTF-8"
+ end
+
+ # Set encoding based on running environment.
+ def encoding
+ if developer?
+ "UTF-8"
+ else
+ "ISO-8859-1"
+ end
+ end
+
class MissingEnvironmentError < StandardError; end
class MissingConfigurationError < StandardError; end
end