Stumbling onto an encoding problem right from the start

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Stumbling onto an encoding problem right from the start

MonKe

Hello,

I just started using Awestruct on a real project, after a few tests. Thanks, it looks awesome.

It'll look even better when I'll get a proper website generation, though : all was well until I tried to compile a few pages and ended up with Ruby struggling to get encoding right.

« incompatible character encodings: UTF-8 and ASCII-8BIT »
is what he told me. WTF, already? I answered, to no avail.

After walking around search engines for a while, I learned that a number of things could cause this, and apparently I'm doing none of them. I don't use any mysql database (obviously), and all my files are UTF-8-encoded (I double-checked with the vim command :set fenc).

What seems to trigger the thing is when I include content from markdown posts. It's fine with metadata, even when I throw in some funky chars (same file). But trow in a line like = page.content or = content and it's getting all epileptic already.

My very amateur guess is that the markdown parser could be trying to send me ascii-encoded text. That or the Haml thingie could be converting templates and then expecting ascii. A that stage I say "why, oh why!", click on the nice mailing list button and try getting answers from people who know what they're doing.

Anyone got a hinch of what I should be doing?
___________________________

Kevin Thommy
aka MonKe
IntéGraphiste @ Clever Cloud

G+ Tw Tr


Reply | Threaded
Open this post in threaded view
|

Re: Stumbling onto an encoding problem right from the start

MonKe
Some news: I managed to work around this with = content.force_encoding("UTF-8"). wheew.

Now maybe you will also think that this looks really dirty. I'd really love to know if this happens to anyone else in this list, so we can fix it all together and be happily building websites forever and ever.

Thanks!
___________________________

Kevin Thommy
aka MonKe
IntéGraphiste @ Clever Cloud

G+ Tw Tr
Reply | Threaded
Open this post in threaded view
|

Re: Stumbling onto an encoding problem right from the start

cody.lerum
This post was updated on .
Where I've seen this happen before is when I'm copying existing
content. There always ends up being some tick or something in the
content that is a non-standard char. As soon as I track that down
everything is good.

-C

On Wed, Jun 20, 2012 at 5:11 PM, Kevin Thommy
<kevin.thommy@clever-cloud.com> wrote:
> Some news: I managed to work around this with =
> content.force_encoding("UTF-8"). wheew.
>
> Now maybe you will also think that this looks really dirty. I'd really love
> to know if this happens to anyone else in this list, so we can fix it all
> together and be happily building websites forever and ever.
>
> Thanks!
>
> ___________________________
>
> Kevin Thommy aka MonKe
> IntéGraphiste @ Clever Cloud
>
> G+ Tw Tr

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: talk-unsubscribe@awestruct.org

Reply | Threaded
Open this post in threaded view
|

Re: Stumbling onto an encoding problem right from the start

MonKe
Well, I do have non -ascii chars as my content is written in french, but the problem does not seem to come from a copy-paste thing. To verify this I re-wrote my project from scratch (third time =_=) and the very same bug applies.

The markdown handler just chokes on this char: "ç" and then spits some non-UTF-8 on my face. If I didn't know him I'd say he is not very friendly.

Only thing I can't say is if the problem is local (like: on my computer) or if it does really come from Awestruct or one of its dependencies. Could someone check this suspicious char and see if everything breaks down too? :)
___________________________

Kevin Thommy
aka MonKe
IntéGraphiste @ Clever Cloud

G+ Tw Tr