{"action":"created","issue":{"url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/419","repository_url":"https://api.github.com/repos/CocoaPods/Xcodeproj","labels_url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/419/labels{/name}","comments_url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/419/comments","events_url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/419/events","html_url":"https://github.com/CocoaPods/Xcodeproj/pull/419","id":178262385,"number":419,"title":"Fix Encoding::UndefinedConversionError","user":{"login":"cpunion","id":8459,"avatar_url":"https://avatars.githubusercontent.com/u/8459?v=3","gravatar_id":"","url":"https://api.github.com/users/cpunion","html_url":"https://github.com/cpunion","followers_url":"https://api.github.com/users/cpunion/followers","following_url":"https://api.github.com/users/cpunion/following{/other_user}","gists_url":"https://api.github.com/users/cpunion/gists{/gist_id}","starred_url":"https://api.github.com/users/cpunion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpunion/subscriptions","organizations_url":"https://api.github.com/users/cpunion/orgs","repos_url":"https://api.github.com/users/cpunion/repos","events_url":"https://api.github.com/users/cpunion/events{/privacy}","received_events_url":"https://api.github.com/users/cpunion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-21T06:56:38Z","updated_at":"2016-09-21T12:55:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CocoaPods/Xcodeproj/pulls/419","html_url":"https://github.com/CocoaPods/Xcodeproj/pull/419","diff_url":"https://github.com/CocoaPods/Xcodeproj/pull/419.diff","patch_url":"https://github.com/CocoaPods/Xcodeproj/pull/419.patch"},"body":"Fix #418 \r\n\r\nCan't write a simple case to reproduce the problem, just encoding marshaled data to base64."},"comment":{"url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/comments/248603694","html_url":"https://github.com/CocoaPods/Xcodeproj/pull/419#issuecomment-248603694","issue_url":"https://api.github.com/repos/CocoaPods/Xcodeproj/issues/419","id":248603694,"user":{"login":"cpunion","id":8459,"avatar_url":"https://avatars.githubusercontent.com/u/8459?v=3","gravatar_id":"","url":"https://api.github.com/users/cpunion","html_url":"https://github.com/cpunion","followers_url":"https://api.github.com/users/cpunion/followers","following_url":"https://api.github.com/users/cpunion/following{/other_user}","gists_url":"https://api.github.com/users/cpunion/gists{/gist_id}","starred_url":"https://api.github.com/users/cpunion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpunion/subscriptions","organizations_url":"https://api.github.com/users/cpunion/orgs","repos_url":"https://api.github.com/users/cpunion/repos","events_url":"https://api.github.com/users/cpunion/events{/privacy}","received_events_url":"https://api.github.com/users/cpunion/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T12:55:55Z","updated_at":"2016-09-21T12:55:55Z","body":"I just copied and modified two tests, and not reproduced yet. I need it passes first, because no `Encoding::UndefinedConversionError` throws, but some errors thrown.\r\n\r\nI copied a test from:\r\n```\r\n      it 'escapes non ASCII characters in the project' do\r\n        Plist::FFI.stubs(:ruby_hash_write_xcode).returns(false)\r\n\r\n        file_ref = @project.new_file('わくわく')\r\n        file_ref.name = 'わくわく'\r\n        file_ref = @project.new_file('Cédric')\r\n        file_ref.name = 'Cédric'\r\n        @project.save(@tmp_path)\r\n        contents = File.read(@tmp_path + 'project.pbxproj')\r\n        contents.should.not.include('わくわく')\r\n        contents.should.include('&#12431;&#12367;&#12431;&#12367;')\r\n        contents.should.not.include('Cédric')\r\n        contents.should.include('C&#233;dric')\r\n      end\r\n```\r\n\r\nAnd modified to:\r\n```\r\n      it 'escapes non ASCII characters in the project and really save' do\r\n        file_ref = @project.new_file('わくわく')\r\n        file_ref.name = 'わくわく'\r\n        file_ref = @project.new_file('Cédric')\r\n        file_ref.name = 'Cédric'\r\n        @project.save(@tmp_path)\r\n        new_instance = Xcodeproj::Project.open(@tmp_path)\r\n        new_instance.should.eql @project\r\n      end\r\n\r\n      it 'escapes non ASCII characters in the project and fork to save' do\r\n        ENV.stubs(:[]).with(\"FORK_XCODE_WRITING\").returns(\"true\")\r\n\r\n        file_ref = @project.new_file('わくわく')\r\n        file_ref.name = 'わくわく'\r\n        file_ref = @project.new_file('Cédric')\r\n        file_ref.name = 'Cédric'\r\n        @project.save(@tmp_path)\r\n        new_instance = Xcodeproj::Project.open(@tmp_path)\r\n        new_instance.should.eql @project\r\n      end\r\n```\r\n\r\nIt throws errors:\r\n```\r\nBacon::Error: #<Xcodeproj::Project> path:`/Users/lijie/source/Xcodeproj/tmp/Pods.xcodeproj` UUID:`E525238316245A900012E2BA`.eql?(#<Xcodeproj::Project> path:`/Users/lijie/source/Xcodeproj/spec/fixtures/Sample Project/Cocoa Application.xcodeproj` UUID:`E525238316245A900012E2BA`) failed\r\n       \tspec/project_spec.rb:247:in `block (3 levels) in <module:ProjectSpecs>': #Save - escapes non ASCII characters in the project and really save\r\n       \tspec/project_spec.rb:240:in `block (2 levels) in <module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:166:in `block in <module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:6:in `<module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:5:in `<top (required)>'\r\n       \t/Users/lijie/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'\r\n       \t/Users/lijie/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'\r\n\r\nBacon::Error: #<Xcodeproj::Project> path:`/Users/lijie/source/Xcodeproj/tmp/Pods.xcodeproj` UUID:`E525238316245A900012E2BA`.eql?(#<Xcodeproj::Project> path:`/Users/lijie/source/Xcodeproj/spec/fixtures/Sample Project/Cocoa Application.xcodeproj` UUID:`E525238316245A900012E2BA`) failed\r\n       \tspec/project_spec.rb:260:in `block (3 levels) in <module:ProjectSpecs>': #Save - escapes non ASCII characters in the project and fork to save\r\n       \tspec/project_spec.rb:250:in `block (2 levels) in <module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:166:in `block in <module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:6:in `<module:ProjectSpecs>'\r\n       \tspec/project_spec.rb:5:in `<top (required)>'\r\n       \t/Users/lijie/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'\r\n       \t/Users/lijie/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'\r\n```\r\n\r\nI need it passed first and then modify to reproduce the `Encoding::UndefinedConversionError`.\r\n\r\nHow to fix that?"}}
{"actor":{"display_login":"cpunion"}}