diff --git a/SocketIO-MacTests/SocketEngineTest.swift b/SocketIO-MacTests/SocketEngineTest.swift index 90ef328..27c1c19 100644 --- a/SocketIO-MacTests/SocketEngineTest.swift +++ b/SocketIO-MacTests/SocketEngineTest.swift @@ -74,4 +74,18 @@ class SocketEngineTest: XCTestCase { engine.parseEngineMessage("afafafda", fromPolling: false) waitForExpectationsWithTimeout(3, handler: nil) } + + func testEngineDecodesUTF8Properly() { + let expectation = expectationWithDescription("Engine Decodes utf8") + + client.on("stringTest") {data, ack in + if let str = data[0] as? String { + assert(str == "lïne one\nlīne \rtwo", "Failed string test") + expectation.fulfill() + } + } + + engine.parsePollingMessage("41:42[\"stringTest\",\"lïne one\\nlÄ«ne \\rtwo\"]") + waitForExpectationsWithTimeout(3, handler: nil) + } }