V3
V37mo ago

marimo convert encoding

I have been using Marimo for the last month and have just ran into my first issue when converting a jupyter notebook to a marimo notebook. The default encoding in my VSCode is UTF 8, though everytime i ran
marimo convert jupyter.ipynb > marimo.py
marimo convert jupyter.ipynb > marimo.py
my marimo.py would be written in UTF-16 encoding making it unable to be ran in either read or read/write. The problem still persisted when installing marimo with pip 23.1 versus pip 24.0 Overall it was a simple fix within VSCode, just changing my outputted marimo.py file to UTF-8 encoding, but it was still just weird that it was being converted to UTF-16 despite UTF-8 being specified within marimo_ast\codegen.py
10 Replies
Akshay
Akshay7mo ago
Hmm interesting. What OS are you on out of curiosity? I think there are some cross platform issues with relying on console output. Maybe we can add an optional arg to specify an output file. This issue has come up before with Windows issues I believe
V3
V3OP7mo ago
Now that you point it out, it most likely is a Windows issue. I am currently working on my Windows Desktop. This is my first time using marimo on Windows as I've done all of my previous marimo work on MacOS.
Akshay
Akshay7mo ago
Makes sense. I think having an optional arg for writing straight to disk -- so we can control encoding -- may be the way to go
V3
V3OP7mo ago
yes! I've never ran into the issue before with marimo, nor have i ever when coding with Python, but having an optional arg to handle encoding would be perfect!
dmad
dmad7mo ago
Are you installing from pypi or GitHub? I recently touched that code and it shouldn't be happening
Akshay
Akshay7mo ago
due to using click.echo? Didn't realize that -- ok, will hold off on adding a new arg
dmad
dmad7mo ago
That's what I was thinking, but maybe the issue predates that
V3
V3OP7mo ago
im installing from pypi Would it be better practice to install from GitHub moving forward?
dmad
dmad7mo ago
No, pypi is better for stability. Just wanted to make sure I didn't break your code lol
V3
V3OP7mo ago
LOL o, thank you !