cucumber / cucumber/cucumber-ruby

Unable to use feature files with multi-byte characters in filename using cucumber.yml

Open
#1,666 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
5.2k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
3

Description

### 👓 What did you see?

Unable to use feature files with multi-byte characters in the filename (e.g. あ.feature ) when I specified its path in cucumber.yml.
The following error message appears.
```
"\xE3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
```

The paths read in YML are converted from UTF-8 to ASCII-8bit by Shellword in cucumber-8.0.0/lib/cucumber/cli/profile_loader.rb.
This problem can be resolved by using force_encoding("utf-8").

### ✅ What did you expect to see?

I would like it to work even if the path specified in cucumber.yml contains files with multibyte characters.

### 📦 Which tool/library version are you using?

cucumber (8.0.0)

### 🔬 How could we reproduce it?

1. Create a cucumber.yml
```
default: features
```
2. Add an empty file in the 'features' directory named 'あ.feature'
Originally, this feature file will contain test code starting with #language:ja. It is not required for reproduction.
3. Run a test using the 'cucumber' command.
4. See error '"\xE3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) [my_env_path]/cucumber-messages-18.0.0/lib/cucumber/messages/message/serialization.rb:59:in `to_json''

### 📚 Any additional context?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.