gui icon indicating copy to clipboard operation
gui copied to clipboard

WXME contains non-ASCII characters (\u0000) after serialization

Open shhyou opened this issue 2 years ago • 0 comments

Some WXME files contain the null character, which makes it impossible to copy and paste them as plain text. I am not sure if this is intended.

  • Racket version: Welcome to Racket v8.6.0.11 [cs].
  • WXME version: 0111
  • Steps to reproduce:
    1. Open an empty file in DrRacket
    2. Insert a snip, e.g. via Insert -> Insert Fraction
    3. Save as WXME
    4. Check the file content using file->string.
  • Expected result: all characters are ASCII
  • Actual result: there is a nul character after (lib \"image-core-wxme.rkt\" \"mrlib\" and other classnames
Welcome to Racket v8.6.0.11 [cs].
> (file->string "wxm.rkt")
"#reader(lib\"read.ss\"\"wxme\")WXME0111 ## \n#|\n   This file uses the GRacket editor format.\n   Open this file in DrRacket version 8.6.0.11 or later to read it.\n\n   Most likely, it was created by saving a program in DrRacket,\n   and it probably contains a program with non-text elements\n   (such as images or comment boxes).\n\n            http://racket-lang.org/\n|#\n 29 7 #\"wxtext\\0\"\n3 1 6 #\"wxtab\\0\"\n1 1 8 #\"wximage\\0\"\n2 0 8 #\"wxmedia\\0\"\n4 1 34 #\"(lib \\\"syntax-browser.ss\\\" \\\"mrlib\\\")\\0\"\n1 0 36 #\"(lib \\\"cache-image-snip.ss\\\" \\\"mrlib\\\")\\0\"\n1 0 68\n(0 68\n((lib \"image-core.ss\" \"mrlib\") (lib \"image-core-wxme.rkt\" \"mrlib\"))\u0000\n) 1 0 16 ...

shhyou avatar Sep 13 '22 07:09 shhyou