Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add separate test for the initial problem (passing); disable failing …
…test
  • Loading branch information
pkese committed Jun 8, 2021
commit 4674b5c55d419a50801c6813ab4238db2d9860ad
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- Meinrad Recheis ([@henon](https://github.com/henon))
- Mohamed Koubaa ([@koubaa](https://github.com/koubaa))
- Patrick Stewart ([@patstew](https://github.com/patstew))
- Peter Kese ([@patstew](https://github.com/pkese))
- Raphael Nestler ([@rnestler](https://github.com/rnestler))
- Rickard Holmberg ([@rickardraysearch](https://github.com/rickardraysearch))
- Sam Winstanley ([@swinstanley](https://github.com/swinstanley))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ One must now either use enum members (e.g. `MyEnum.Option`), or use enum constru
- Exception stacktraces on `PythonException.StackTrace` are now properly formatted
- Providing an invalid type parameter to a generic type or method produces a helpful Python error
- Empty parameter names (as can be generated from F#) do not cause crashes
- Unicode strings with surrogates get truncated when converting from Python
Comment thread
pkese marked this conversation as resolved.
Outdated

### Removed

Expand Down
10 changes: 10 additions & 0 deletions src/embed_tests/TestPyString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ public void TestUnicode()
}

[Test]
public void TestUnicodeSurrogateToString()
{
var expected = "foo\ud83d\udc3c";
var actual = PythonEngine.Eval("'foo\ud83d\udc3c'");
Assert.AreEqual(4, actual.Length());
Assert.AreEqual(expected, actual.ToString());
}

[Test]
[Ignore("Bug: Unicode conversion issue #1466")]
public void TestUnicodeSurrogate()
{
const string expected = "foo\ud83d\udc3c"; // "foo🐼"
Expand Down