babashka 2025-10-02

One last call for testing for Windows users and UTF-8 encoding output in their terminal, most specifically Powershell. I received a better solution for this from the GraalVM team. You can install a dev executable with this in Git bash: bash <(curl ) --dev-build --dir . This downloads the bb dev executable in the current working directory. Then test it by printing some unicode characters from a script. E.g. "λ⚙️中文" . They should not look garbled in Powershell. You may or may not have to set the following in Powershell: $OutputEncoding = [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() Thanks for testing. 🧵

✅ 1

cc @chuck.cassel @highpressurecarsalesm and possibly other people regularly on Windows

Firing up my old Windows 10 VM...

🙌 1

Unfortunately the install cmd doesn't work from by bash on Windows:

lee@DESKTOP-SOKQ82B  /z/-verify/unicode-powershell
$ bash <(curl )  --dev-build --dir .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5644  100  5644    0     0  24250      0 --:--:-- --:--:-- --:--:-- 24539
/dev/fd/63: line 142: platform: unbound variable

w0000t

🎉 1

let's fix that

@lee what does uname -s return in your git bash?

MSYS_NT-10.0-19045

this is git bash?

I think so. I hava a scoop-installed git. But I may have a mish-mash-mess of historical bash gunk.

I mean is that the "app" you're starting or is it called something else?

Oh. I just ran bash from the powershell cmd line.

To get into a bash shell.

does that launch another window or starts bash.exe or does it start WSL2?

I don't have WSL2. How do you launch bash on windows?

I'll try to do some cleanup of old gunk and reinstall git bash.

I asked chatgpt that this is likely git bash. I also have something like that, but in github actions it's something slightly else. so mingw_nt instead of msys_nt

edited the install script now and pushed. try again once github cache busts this script

no need to reinstall!

the behavior is normal, I was just trying to understand

Ok! I'm back in business and have successfully installed bb

PS C:\Users\lee> ./bb --version
babashka v1.12.209-SNAPSHOT
I uninstalled git with scoop and also uninstalled a Git from "Add and Remove Programs" under Settings, then reinstalled git with scoop. Which seems to be "PortableGit" if that matters (which is doesn't seem to).

And now the UTF-8 test in PS?

First though. I created a test.clj on Linux:

(println "λ⚙️中文")
Would you expect me to be able to cat that on Powershell? I get:
PS Z:\-verify\unicode-powershell> cat test.clj
(println "λ⚙ï¸ä¸æ–‡")

no, run it on powershell

My PowerShell tests:

PS Z:\-verify\unicode-powershell> ./bb --version
babashka v1.12.209-SNAPSHOT
PS Z:\-verify\unicode-powershell> bb --version
babashka v1.12.208
PS Z:\-verify\unicode-powershell> ./bb test.clj
λ⚙️中文
PS Z:\-verify\unicode-powershell> bb test.clj
?????
PS Z:\-verify\unicode-powershell> $OutputEncoding = [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
PS Z:\-verify\unicode-powershell> ./bb test.clj
λ⚙️中文
PS Z:\-verify\unicode-powershell> bb test.clj
?????
NOTE: Although the output looks good from the paste for bb dev after $OutputEncoding , I actually see (which is probably a font problem):

yeah you need to choose a different font as well

I guess we need to document this stuff somewhere...

Windows seems a bit unpolished here and there. Have you noticed that?

What font are you using for PowerShell?

I'm using Windows terminal which probably uses some default font that works nice?

how can I check?

got it. it's Cascadia Mono in powershell

via Windows Terminal

Oh right, I forgot about Windows Terminal. This thing right? https://github.com/microsoft/terminal Tried it and it prints the test.clj output fine.

with and without the UTF-8 setting?

Only printed nice after I ran $OutputEncoding = [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

I just shut down my VM, lemme fire it up again and double-check that for you...

Yup, what I said is true:

ok no probs. we're going to document this somewhere. maybe on wiki or so

thanks for testing!

👍 1