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

it doesn't accept non-ascii characters in file path #150

Closed
germanogmn1 opened this issue Sep 30, 2011 · 9 comments
Closed

it doesn't accept non-ascii characters in file path #150

germanogmn1 opened this issue Sep 30, 2011 · 9 comments
Milestone

Comments

@germanogmn1
Copy link

If I put features in a directory that contains utf-8 characters in the name, when I run cucumber I get the following error:

incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
@aslakhellesoy
Copy link
Contributor

What is the path, what OS are you on and what ruby version are you running?

@germanogmn1
Copy link
Author

I have tested on Linux and Mac OS with ruby 1.9.2-p290.

The path which the error ocurred were ~/Área de Trabalho/project.

@nicholaspufal
Copy link

I confirm this issue.

I did replicate it on my Mac.

Simply create a dir and name it with special characters (such as a simple ç for example). Inside, create a basic structure for Cucumber (add a feature to /features and it's step definitions to /features/step_definitions/). All that can be done in english.

Now, when you run "cucumber" in a shell, the error will pop up and the task is going to be aborted.

@germanogmn1
Copy link
Author

The error occurs when I add a single step definition.
Here's a better explanation of the error:
http://pastie.org/2622727

@edivandecastro
Copy link

I'm also having the same problem.

ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
cucumber (1.2.1)

The error
http://pastie.org/4521692

Within the directory Hello have:
features/ greeter_spec.rb spec/

The file greeter_spec.rb
http://pastie.org/4521700

Who find a solution be sure to alert.

@edivandecastro
Copy link

I found out what the problem really is encoding, but not in the file but in path file.

I have the stack
ruby-1.9.2-p290@rails3-2-3-x86_64-linux- edivansoares@9678:~/Área de Trabalho/Hello>

the problem that the "Área de Trabalho" was to be "desktop", but "desktop" in Portuguese is "Área de Trabalho".

To resolve or change to a directory without special characters or places that force_encoding ('utf-8')
in/cucumber-1.2.1/lib/cucumber/core_ext/proc.rb

cucumber developers could solve this problem.

@mattwynne
Copy link
Member

@edivandecastro you could be a Cucumber developer! Send us a (tested) pull request with the fix and I'll merge it in.

@os97673
Copy link
Member

os97673 commented Mar 8, 2013

I love m17n! Proc.to_s returns string in ASCII-8BIT encoding even if path has unicode characters. But Dir.pwd returns utf-8 string and String#index can not work with it.
Thus I've forced ASCII-8BIT for pwd too and it looks like everything is working now.
But definitely ruby has some problems with encodings and it is very strange to see them in the language which is developed in non-English speaking country :(

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants