jeromegn / slang

Slim-inspired templating language for Crystal
MIT License
236 stars 30 forks source link

Multibyte characters handling improvement. #52

Closed SlayerShadow closed 5 years ago

SlayerShadow commented 5 years ago

Currently when multibyte string is used in tags, the string is truncated at the beginning - parser consumes several bytes of text. Larger text - more bytes will be consumed. Even there are conditions when consumed half of multibyte character that leads to curious result.

When the source contains

p Милиамперметр

The result looks like:

<p>�ерметр</p>

This PR fixes the problem. Specs are also added.

jeromegn commented 5 years ago

Thanks! Looks good.

wonderix commented 3 years ago

Hi @jeromegn, would it be possible to create a release, which contains this fix? As far as I can see v1.7.1 doesn't include this fix.

jeromegn commented 3 years ago

Just released v1.7.2 (I think).

wonderix commented 3 years ago

Thanks.