-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
Windows doesn't support chinese sample #2660
Comments
👋 Can you explain your problem in more detail? What are you trying to achieve thats causing this? |
when using rspec to test a test case in UTF-8 chinese name like: describe AATM::Build::Mapper do
describe '将 嵌套哈希数据 转换为 树结构' do
it '空测试套' do
pus "test"
end
end
end in this code with windows using cmd: rspec D:/git/auto-agent/spec/build/mapper_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example "AATM::Build::Mapper 将 嵌套哈希数据 转换为 树结构 空测试套" with rubymine ide |
I don't have a windows machine at the moment but this reproduction script might help us: begin
require "bundler/inline"
rescue LoadError => e
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rspec"
gem "rspec-teamcity"
end
require 'rspec/autorun'
RSpec.configure do |c|
c.add_formatter Spec::Runner::Formatter::TeamcityFormatter
c.default_formatter = Spec::Runner::Formatter::TeamcityFormatter
end
RSpec.describe 'rspec/rspec/44' do
describe '将 嵌套哈希数据 转换为 树结构' do
it '空测试套' do
puts "test"
end
end
end |
the key to this problem is not the name in the "describe " or the name in the "it '空测试套' do" rspec D:/git/auto-agent/spec/build/mapper_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example "AATM::Build::Mapper 将 嵌套哈希数据 转换为 树结构 空测试套" the chinese or other none english key name(in the --example) will transfer in the windows encoding (such as gb2312 in chinese or Shift_JIS in japan. ) and we can't change the windows encoding as we can do in linux. the code you posted i have run in my windows env, is ok to pass. Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using bundler 1.16.0
Using diff-lcs 1.3
Using rspec-support 3.8.2
Using rspec-core 3.8.2
Using rspec-expectations 3.8.4
Using rspec-mocks 3.8.1
Using rspec 3.8.0
Using rspec-teamcity 1.0.0
##teamcity[enteredTheMatrix timestamp = '2019-07-29T20:22:40.021+0800']
##teamcity[testCount count = '1' timestamp = '2019-07-29T20:22:40.084+0800']
##teamcity[testSuiteStarted name = 'rspec/rspec/44' locationHint = 'file://D:/test.rb:22' timestamp = '2019-07-29T20:22:40.085+0800']
##teamcity[testSuiteStarted name = '将 嵌套哈希数据 转换为 树结构' locationHint = 'file://D:/test.rb:23' timestamp = '2019-07-29T20:22:40.085+0800']
##teamcity[testStarted name = '将 嵌套哈希数据 转换为 树结构 空测试套' captureStandardOutput = 'true' locationHint = 'file://D:/test.rb:24' timestamp = '2019-07-29T20:22:40.085+0800']
test
##teamcity[testFinished name = '将 嵌套哈希数据 转换为 树结构 空测试套' duration = '1564402960086' diagnosticInfo = 'rspec |[3.8.2|], f/s=(1564402960086, 0), duration=1564402960086, time.now=2019-07-29 20:22:40 +0800, raw|[:started_at|]=2019-07-29 20:22:40 +0800, raw|[:finished_at|]=2019-07-29 20:22:40 +0800, raw|[:run_time|]=0.000956' timestamp = '2019-07-29T20:22:40.086+0800']
##teamcity[testSuiteFinished name = '将 嵌套哈希数据 转换为 树结构' timestamp = '2019-07-29T20:22:40.086+0800']
##teamcity[testSuiteFinished name = 'rspec/rspec/44' timestamp = '2019-07-29T20:22:40.086+0800']
1 example, 0 failures, 1 passed
Finished in 0.003988 seconds is that any chance the rspec will handle the command line encoding corrected and we as a user can ignore the difference in windows encoding and linux encoding. |
I am wondering if this PR change can help you? https://github.com/rspec/rspec-core/pull/2575/files Just to notice that it is still not fixed: #2543 (comment) |
@WoolenWang Can you figure out the difference between the code @benoittgt provided and yours to understand why yours fails and the script provided provides correct output? A pull request that fails on AppVeyor would sure be very helpful. I'll close the issue meanwhile, since otherwise it's not clear how to reproduce the problem and how to fix it. Please feel free to reopen. |
The problem's pretty clear, Chinese string's being passed in from the command line on windows are not being parsed properly, the issue I, we, have is trying to replicate it to fix it, ideally we need a chinese person to help! |
The text was updated successfully, but these errors were encountered: