C++20 std::format fails

I’m using ROOT with C++20 in Jupyter Notebooks.
I tested some C++20 features. std::span works.
But std::format fails. I ran a notebook with the single line

std::format("Hello World!")

This failed with the error message

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 60000: invalid start byte

I can add that

std::string("Hello World!")

works with output

(std::string) "Hello World!"

Environment:

  • Windows 11
  • ROOT 6.40.02
  • CMake 4.4.0, configured with -DCMAKE_CXX_STANDARD=20.
  • Visual Studio 2022

Maybe related: https://its.cern.ch/jira/browse/ROOT-9562

@ferhue I’m not able to log in to Jira. Am I supposed to be able to?

Not needed, was just a pointer for developers.

Anyway, that JIRA report just mentions Ubuntu Xenial cling interpreter terminal unicode problem - #8 by Axel

But I got an error with just plain ASCII, so this is something else.

Maybe this helps?

set PYTHONIOENCODING=utf-8
set PYTHONUTF8=1
jupyter notebook

?

It makes no difference, still the same error. In the console I get the following error message:

Traceback (most recent call last):
  File "C:\Users\johan\miniconda3\Lib\site-packages\ipykernel\kernelbase.py", line 377, in process_control
	await result
  File "C:\Users\johan\miniconda3\Lib\site-packages\ipykernel\kernelbase.py", line 1144, in debug_request
	reply_content = await reply_content
					^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johan\miniconda3\Lib\site-packages\ipykernel\kernelbase.py", line 1207, in do_debug_request
	raise NotImplementedError
NotImplementedError