Title: GitHub · Where software is built
Open Graph Title: pythonnet/pythonnet
X Title: pythonnet/pythonnet
Description: Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. - pythonnet/pythonnet
Open Graph Description: Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET develo...
X Description: Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET develo...
Opengraph URL: https://github.com/pythonnet/pythonnet
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Encoding issue. PyScope.Exec()","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.4.0.dev\r\n- Python version: 3.7\r\n- Operating System: Win10\r\n\r\n### Details\r\n\r\n- I have a script, represented by a string in .net side: \r\n` string script = \"a = \\\"Привет\\\"\";` \r\n\r\nI try to run this script, using PyScope.Exec()\r\n```\r\npublic void ExecuteScript(string script, IDictionary\u003cstring, object\u003e locals)\r\n {\r\n _scriptLocals = new PyDict();\r\n\r\n using (Py.GIL())\r\n {\r\n if (locals != null)\r\n foreach (var local in locals)\r\n _scriptLocals[local.Key] = local.Value.ToPython();\r\n\r\n using (var pythonScope = Py.CreateScope())\r\n {\r\n pythonScope.Exec(script, _scriptLocals);\r\n }\r\n }\r\n }\r\n```\r\nWhen I run method pythonScope.Exec(script, _scriptLocals), I get an exception:\r\n\r\n\u003e SyntaxError : (\"(unicode error) 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte\", ('\u003cstring\u003e', 1, 4, None))\r\n\u003e \r\n\r\nStackTrace is empty\r\n","author":{"url":"https://github.com/NickSavin","@type":"Person","name":"NickSavin"},"datePublished":"2019-02-18T10:52:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/818/pythonnet/issues/818"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:9b90b9c9-2277-3405-0849-ccb5ddf1ee3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FD6:B8167:4A020E0:648D0D6:6973058E |
| html-safe-nonce | fb9829367011dc5c3fbb364abaa8512f15788fcde89f166c4e7c14ce8f5bfcb7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkQ2OkI4MTY3OjRBMDIwRTA6NjQ4RDBENjo2OTczMDU4RSIsInZpc2l0b3JfaWQiOiI3MjEwODE3OTY2NTAzNTYwNTkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2324b1dfbfaf610dfae4565dff9f2cbbc5b3a23d5febf80cfac3ecee1a6de2e1 |
| hovercard-subject-tag | repository:14748123 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/pythonnet/pythonnet/issues/818 |
| twitter:image | https://opengraph.githubassets.com/9c935dd7652ab35690f208dc1d51ed7a9e35329c2b73c92cd32d8e7cefe5a10c/pythonnet/pythonnet |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c935dd7652ab35690f208dc1d51ed7a9e35329c2b73c92cd32d8e7cefe5a10c/pythonnet/pythonnet |
| og:image:alt | Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET develo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-cache |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width