Fix MicroPython badly handling unicode chars (#2018)

## Changes

  * fixed an issue with the **py-editor** related to the new `linebuffer` directive
  * provide in worker hook scope a simple callback that pre-buffers unicode sequences [accordingly to the standard](https://encoding.spec.whatwg.org/#utf-8-bytes-needed) so that the buffer is sent to the terminal only once those sequences are fulfilled
  * test with both `µ` and way more convoluted sequences such as 👩‍❤️‍👨 that the output, if either requested as input or already evaluated from the page works ... in latter case `test = "👩‍❤️‍👨"` completely messes up the program and the resulting string is empty
This commit is contained in:
Andrea Giammarchi
2024-04-09 14:51:10 +02:00
committed by GitHub
parent 6ee8217593
commit 2d5cf096e0
5 changed files with 49 additions and 18 deletions

View File

@@ -10,6 +10,7 @@
</head>
<body>
<script type="mpy" worker terminal>
print("µpython")
import code
code.interact()
</script>