aaronryank / Cubically

An esoteric programming language based on Rubik's Cubes
https://github.com/Cubically
GNU General Public License v3.0
28 stars 6 forks source link

Reading from strings causes segmentation fault #12

Closed aaronryank closed 6 years ago

aaronryank commented 6 years ago

This is due to getwc trying to read a multibyte char from a string that was fmemopen'ed from a single-byte string.

Possible fixes:

aaronryank commented 6 years ago

https://stackoverflow.com/q/45624195/6850771

TehPers commented 6 years ago

Is it possible to manually parse the input as bytes and convert it to UTF-8?

aaronryank commented 6 years ago

Oh that's right, I fixed it. Bytes from Cubically's codepage must be present in the string as Cubically SBCS, not UTF-8.