How to fix Ruby script which fails with encoding error: “\xD8” on US-ASCII?

后端 未结 2 1548
不思量自难忘°
不思量自难忘° 2021-01-19 09:40

I get the following error when running a project with:

cucumber --format junit --guess --out ./

This is the error:

Checkout         


        
相关标签:
2条回答
  • 2021-01-19 10:17

    There are issues with your environments LC encodings.

    Linux

    export LANG=en_US.UTF-8
    

    OS X (pre Mnt. Lion)

    export LC_CTYPE=en_US.UTF-8
    

    OS X (Mnt. Lion and later)

    export LC_ALL=en_US.UTF-8
    
    0 讨论(0)
  • 2021-01-19 10:26

    The problem can be also fixed in Ruby code it-self, by adding the following code:

    Encoding.default_external = Encoding::UTF_8
    Encoding.default_internal = Encoding::UTF_8
    
    0 讨论(0)
提交回复
热议问题