# Trying to understand unicode character entry, goes into postgres DB backing rails, saved to yaml as

**URL:** <https://www.ruby-forum.com/t/trying-to-understand-unicode-character-entry-goes-into-postgres-db-backing-rails-saved-to-yaml-as/125124>\
**Category:** Rails\
**Created:** [January 5, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/trying-to-understand-unicode-character-entry-goes-into-postgres-db-backing-rails-saved-to-yaml-as/125124 "2008-01-05T21:14:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_GSHarms](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2bfe46/32.png) [@Steven\_GSHarms](https://www.ruby-forum.com/u/Steven_GSHarms)\
**Post date:** [January 5, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/trying-to-understand-unicode-character-entry-goes-into-postgres-db-backing-rails-saved-to-yaml-as/125124/1 "2008-01-05T21:14:59Z")

</div>

Examine the Unicode standard’s code page collection for “Latin small  
letter a with macron”.  
Nets U0100.pdf  
“Latin small letter a with macron” appears on chart as 0101. This is a  
hexidemial number which points to U+0101 as its code point. Converting  
0101 to decimal gets you 257, this is the same as the HTML entity  
code.  
HTML code point is 257. That is &257; gives you &257; != 325. OK, so I  
can link this guy back to the Unicode source. But here’s the question,  
what’s up with the two broken values.  
Put &257; character into a view via Rails that is back-ended by a  
PostGres database.  
Using script/console, write the collection of models that contain this  
accented character to a YAML file.  
“Latin small letter a with macron” is stored in a YAML dump of  
accented charcters as: \xC4\x81  
Hm, OK that’s a start. Somehow 0101 or 257 is linked to C4 81 Let’s  
convert those two to decimal and see if correlation becomes clear ( I  
know, BTW, the database that holds that entry is in UTF-8).  
C4: 196  
81: 129  
196+129=325 != 0101. Hm, look at documentation.  
Be stumped.  
Send mail to mailing lists for help.
