[ragel-users] ragel and encodings

Wincent Colaiuta win at wincent.com
Thu May 21 18:59:02 UTC 2009


El 21/5/2009, a las 19:48, Robert Lemmen escribió:

> On Thu, May 21, 2009 at 11:34:35AM -0400, Wil Macaulay wrote:
>> Depends on your platform, but my approach to this problem (on the  
>> Mac)
>> was to detect
>> the encoding, and convert to UTF-8 before parsing. I also converted
>> line-endings (\r\n -> \n)
>> and ensured a newline at the end of the data at the same time.
>
> how do you handle utf-8 in your ragel code? do you use a single-byte
> alphtype and then handle the utf-8 sequences manually?

I work with UTF-8 sequences manually in my Wikitext module. You can  
see the Ragel file here:

http://git.wincent.com/wikitext.git?a=blob;f=ext/wikitext_ragel.rl

Wincent





More information about the ragel-users mailing list