Converting Packed decimal/comp 3 to decimal in ruby or shell

Hi Friends,

I am trying to convert packed decimal to decimal by using ruby or shell but i dont have proper idea.
Input:ƒáÅiŒ
Output:123456789012

suggest me how to convert or if any library or functions or code snippets.