From: Phrogz Date: 2007-12-04T06:19:59+09:00 Subject: Re: Unicode in Regex On Dec 3, 2:07 pm, Greg Willits wrote: > >> >> 'aébvHögtåwHÅFuG'.scan(/[\303\251]/u) > >> => [] > >> >> 'aébvHögtåwHÅFuG'.scan(/[#{"\303\251"}]/u) > >> => ["é"] > > OK, one thing I'm still confused about -- when I look up é in any table, > it's DEC is 233 which converted to OCT is 351, yet you're using 251 (and > indeed it seems like reducing the OCTs I come up with by 100 is what > actually works). > > Where is this 100 difference coming from? http://www.fileformat.info/info/unicode/char/00e9/index.htm The UTF-16 value is 233 (decimal), but the UTF-8 value is 0xC3 0xA9, which is 195 169 in decimal, or 0303 0251 in octal.