postgresql - How to save url encoded emoji as text (eg "%F0%9F%98%80") in Postgres? (RoR) -


i'm struggling save url encoded emoji text.

i use postgresql, ruby 2.2.2, rails 4.1.9. encode/decode emoji use erb::util module http://ruby-doc.org/stdlib-2.2.2/libdoc/erb/rdoc/erb/util.html

on save this

   "%f0%9f%98%80" 

changes this

   "f09f9880" 

is connected postgres column type (text)? or rather active record connected? i'm not sure issue , solutions other dbs or languages not seem make sense in situation.

not answer question, big in different direction find way encode unicode url_encoding (so save decoded , encode again before using).

     "f09f9880" => "%f0%9f%98%80" 

many in advance!

while i'm not sure why postgre won't accept emojis, can suggest encode text base64. may not efficient, given string gets larger, should solve problem.


Comments