{"action":"opened","issue":{"url":"https://api.github.com/repos/pester/Pester/issues/377","labels_url":"https://api.github.com/repos/pester/Pester/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/pester/Pester/issues/377/comments","events_url":"https://api.github.com/repos/pester/Pester/issues/377/events","html_url":"https://github.com/pester/Pester/issues/377","id":91840254,"number":377,"title":"Contain doesn't support Unicode","user":{"login":"tkirill","id":4922699,"avatar_url":"https://avatars.githubusercontent.com/u/4922699?v=3","gravatar_id":"","url":"https://api.github.com/users/tkirill","html_url":"https://github.com/tkirill","followers_url":"https://api.github.com/users/tkirill/followers","following_url":"https://api.github.com/users/tkirill/following{/other_user}","gists_url":"https://api.github.com/users/tkirill/gists{/gist_id}","starred_url":"https://api.github.com/users/tkirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkirill/subscriptions","organizations_url":"https://api.github.com/users/tkirill/orgs","repos_url":"https://api.github.com/users/tkirill/repos","events_url":"https://api.github.com/users/tkirill/events{/privacy}","received_events_url":"https://api.github.com/users/tkirill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-29T15:42:31Z","updated_at":"2015-06-29T15:42:31Z","closed_at":null,"body":"This test fails:\r\n\r\n    Set-StrictMode -Version Latest\r\n\r\n    InModuleScope Pester {\r\n        Describe \"PesterContain\" {\r\n            Context \"when testing file contents\" {\r\n                Setup -File \"test.txt\" \"this is line 1`nrush is awesome`nAnd this is Unicode: ☺\"\r\n\r\n                It \"returns true if the file contains the specified UTF8 content\" {\r\n                    Test-PositiveAssertion (PesterContain \"$TestDrive\\test.txt\" \"☺\")\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\nLikely other assertions has this problem too.  I see two ways to fix this:\r\n\r\n1.  Assume files to be checked is in UTF8.\r\n2.  Provide `-Encoding` option for `Contain` assertion and for other assertions if needed.\r\n\r\nI like first option because it works for almost everyone, it is simple intuitive and it has backward compatibility with ASCII. Also, it is trivial to implement if I don't miss some hidden difficulties.\r\n\r\nSecond option is more flexible but it is a question if somebody will ever need this flexibility."}}