Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to deface haml template with UTF-8 chars inside #145

Open
Em-AK opened this issue Jun 11, 2015 · 1 comment
Open

Fail to deface haml template with UTF-8 chars inside #145

Em-AK opened this issue Jun 11, 2015 · 1 comment

Comments

@Em-AK
Copy link

Em-AK commented Jun 11, 2015

When I deface my template with no UTF-8 characters in it, everything is working well. (for the purpose of this bug report the deface is just removing the h2 element)

$ rake deface:get_result\['multipass/admin/admin/index'\] --trace
** Invoke deface:get_result (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute deface:get_result
---------------- Before ----------------
<h2>Synthese</h2>
<%= render 'admin/shared/nav' %>

---------------- Overrides (1)--------
- 'multipass/home/engine_add_schools_to_admin_nav' will be applied.

---------------- After ----------------

<%= render 'admin/shared/nav' %>

---------------- Diff -----------------
-<h2>Synthese</h2>
+
 <%= render 'admin/shared/nav' %>

I change my template from

%h2 Synthese
= render 'admin/shared/nav'

to

%h2 Synthèse
= render 'admin/shared/nav'

When I deface the second template (which contains some UTF-8) the operation fails with
Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8

$ rake deface:get_result\['multipass/admin/admin/index'\] --trace
** Invoke deface:get_result (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute deface:get_result
---------------- Before ----------------
rake aborted!
Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/haml-4.0.6/lib/haml/compiler.rb:42:in `encode'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/haml-4.0.6/lib/haml/compiler.rb:42:in `precompiled'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/haml-4.0.6/lib/haml/compiler.rb:47:in `precompiled_with_return_value'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/haml-4.0.6/lib/haml/engine.rb:129:in `render'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/deface-1.0.1/lib/deface/haml_converter.rb:102:in `result'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/deface-1.0.1/lib/deface/template_helper.rb:24:in `load_template_source'
/home/emak/.rvm/gems/ruby-2.2.2@famille/gems/deface-1.0.1/tasks/utils.rake:37:in `block (2 levels) in <top (required)>'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/emak/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/emak/.rvm/rubies/ruby-2.2.2/bin/rake:33:in `<main>'
Tasks: TOP => deface:get_result
@bartlomiejmatlega
Copy link

bartlomiejmatlega commented May 28, 2016

I've got this same error :( It looks like deface still does not fully support haml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants