Problem with non ascii characters in yaml files
Hello, I am discovering Dancer. I take this opportunity to thanks the developpers for their works. Coding with dancer is very funny. My first project is a little site. To generate page of the site, I need some strings stored in a site.yml file. The pages are displayed correctly except the non-ascii characters from the strings in the site.yml file. All the files of my project are in utf8. In the config.yml, I have charset: "UTF-8" engines: template_toolkit: encoding: 'utf8' The site.yml is correctly parse. A dump in my terminal proves it. A workaround is to use ISO-8819-1 encoding for my site.yml file. Thanks for any idea. -- Eric
On 13/01/2011 18:27, Eric GUIRBAL wrote:
Hello,
I am discovering Dancer. I take this opportunity to thanks the developpers for their works. Coding with dancer is very funny.
My first project is a little site. To generate page of the site, I need some strings stored in a site.yml file. The pages are displayed correctly except the non-ascii characters from the strings in the site.yml file.
All the files of my project are in utf8. In the config.yml, I have
charset: "UTF-8" engines: template_toolkit: encoding: 'utf8'
YAML::Syck module has problems with UTF-8 What YAML module is used by Dancer?
The site.yml is correctly parse. A dump in my terminal proves it.
A workaround is to use ISO-8819-1 encoding for my site.yml file.
Thanks for any idea.
On 13/01/2011 18:27, Eric GUIRBAL wrote:
Hello,
I am discovering Dancer. I take this opportunity to thanks the developpers for their works. Coding with dancer is very funny.
My first project is a little site. To generate page of the site, I need some strings stored in a site.yml file. The pages are displayed correctly except the non-ascii characters from the strings in the site.yml file.
All the files of my project are in utf8. In the config.yml, I have
charset: "UTF-8" engines: template_toolkit: encoding: 'utf8'
YAML::Syck module has problems with UTF-8 What YAML module is used by Dancer?
The site.yml is correctly parse. A dump in my terminal proves it.
A workaround is to use ISO-8819-1 encoding for my site.yml file.
Thanks for any idea.
To reproduce the problem. $ dancer -a test Then add in config.yml: quote: > Avant de choisir le prénom d'un garçon, pensez toujours à la femme qui aura à le murmurer plus tard. And in index.tt: <blockquote> <% settings.quote %> </blockquote> Launch the app and point your browser on http://localhost:3000/ to see the lovely quote from Barbey d'Aurevilly disfigured. Tested with dancer 1.2003. Regards. -- Eric
On 13/01/2011 19:36, Eric Guirbal wrote:
To reproduce the problem.
$ dancer -a test
Then add in config.yml:
quote: > Avant de choisir le prénom d'un garçon, pensez toujours à la femme qui aura à le murmurer plus tard.
And in index.tt:
<blockquote> <% settings.quote %> </blockquote>
Launch the app and point your browser on http://localhost:3000/ to see the lovely quote from Barbey d'Aurevilly disfigured.
Tested with dancer 1.2003.
YAML version? 0.72 here and working.
I'm happy you're enjoying Dancer, and thank you for the kind words! :) On Thu, Jan 13, 2011 at 10:28 PM, Eric Guirbal <eric.guirbal@gmail.com>wrote:
ambs wrote:
YAML version? 0.72 here and working.
Bravo. I've just updated YAML and it works too. Maybe this should be added in the documentation.
ambs++ This should be added as a minimal dependency. Someone suggested to use Any::YAML, perhaps we should consider changing YAML for it, so people could use YAML::Tiny, to get even lighter apps. Sawyer.
sawyer x wrote: ..
This should be added as a minimal dependency. Someone suggested to use Any::YAML, perhaps we should consider changing YAML for it, so people could use YAML::Tiny, to get even lighter apps.
Maybe we need "Ballerina," a really, really light-weight Dancer fork (nano-framework) with all the *::Tiny modules. I am currently very happy with Template::Tiny. That said, I think Dancer is probably a very small part of the rest of the application's "weight." -- Puneet Kishor
On Fri, Jan 14, 2011 at 12:31 AM, Puneet Kishor <punk.kish@gmail.com> wrote:
sawyer x wrote: ..
This should be added as a minimal dependency. Someone suggested to use Any::YAML, perhaps we should consider changing YAML for it, so people could use YAML::Tiny, to get even lighter apps.
Maybe we need "Ballerina," a really, really light-weight Dancer fork (nano-framework) with all the *::Tiny modules. I am currently very happy with Template::Tiny.
That said, I think Dancer is probably a very small part of the rest of the application's "weight."
I don't have a problem with the existing nano-frameworks on CPAN, but I personally do not understand them entirely. Dancer is very light-weight, and is truly slim. Many things are interchangable in it and many can be removed entirely. Any lighter than this, you'd just write your own PSGI handler, and.. what's the point of that? I stopped writing CGIs *because of it*.
sawyer x wrote:
On Fri, Jan 14, 2011 at 12:31 AM, Puneet Kishor <punk.kish@gmail.com <mailto:punk.kish@gmail.com>> wrote:
sawyer x wrote: ..
This should be added as a minimal dependency. Someone suggested to use Any::YAML, perhaps we should consider changing YAML for it, so people could use YAML::Tiny, to get even lighter apps.
Maybe we need "Ballerina," a really, really light-weight Dancer fork (nano-framework) with all the *::Tiny modules. I am currently very happy with Template::Tiny.
That said, I think Dancer is probably a very small part of the rest of the application's "weight."
I don't have a problem with the existing nano-frameworks on CPAN, but I personally do not understand them entirely.
Dancer is very light-weight, and is truly slim. Many things are interchangable in it and many can be removed entirely. Any lighter than this, you'd just write your own PSGI handler, and.. what's the point of that? I stopped writing CGIs *because of it*.
Right, that is what I said. I was responding to your comment
so people could use YAML::Tiny, to get even lighter apps
to which I said, "That said, I think Dancer is probably a very small part of the rest of the application's 'weight.'" I think you are and I concur.
Hello On 13/01/2011 22:28, sawyer x wrote:
This should be added as a minimal dependency. Someone suggested to use Any::YAML, perhaps we should consider changing YAML for it, so people could use YAML::Tiny, to get even lighter apps.
YAML::Any is *NOT* a good solution. If all back-ends were equally good (parsing the same definition of YAML but at different speeds) that would be good. But there are (is) some YAML back-ends in the list of YAML::Any that have some serious bugs. For instance, YAML::Syck has some problems on parsing some specific constructs. So, I would suggest to stick to your preferred YAML implementation. Cheers ambs
On Fri, Jan 14, 2011 at 12:32 AM, ambs <ambs+dancer@perl-hackers.net<ambs%2Bdancer@perl-hackers.net>
wrote:
Hello
So, I would suggest to stick to your preferred YAML implementation.
That's good to know. Thanks for the input. :)
participants (6)
-
Alberto Simoes -
ambs -
Eric GUIRBAL -
Eric Guirbal -
Puneet Kishor -
sawyer x