Created
October 6, 2016 01:27
-
-
Save abelorian/36a5f1a47eeccd505219d517763f548f to your computer and use it in GitHub Desktop.
Paypal PIN and Rails: ActiveRecord::StatementInvalid: PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8": 0xf3 0x6e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def paypal_method | |
transaction_subject = clean_param params[:transaction_subject] | |
end | |
def clean_param value | |
return '' if value.nil? | |
value.to_s.encode('UTF-8', :invalid => :replace, :undef => :replace) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment