# C++20 std::format fails

**URL:** <https://root-forum.cern.ch/t/c-20-std-format-fails/64969>\
**Category:** Newbie\
**Tags:** bug, root\
**Created:** [August 8, 2026, 11:16am UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969 "2026-08-08T11:16:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanr](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/johanr/32/39968_2.png) [@johanr](https://root-forum.cern.ch/u/johanr)\
**Post date:** [August 8, 2026, 11:16am UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/1 "2026-08-08T11:16:47Z")

</div>

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

```auto
std::format("Hello World!")

```

This failed with the error message

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

```

I can add that

```auto
std::string("Hello World!")

```

works with output

```auto
(std::string) "Hello World!"

```

Environment:

- Windows 11
- ROOT 6.40.02
- CMake 4.4.0, configured with -DCMAKE\_CXX\_STANDARD=20.
- Visual Studio 2022

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 10, 2026, 8:25am UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/2 "2026-08-10T08:25:56Z")

</div>

Maybe related: [https://its.cern.ch/jira/browse/ROOT-9562](https://its.cern.ch/jira/browse/ROOT-9562)

---

<div class="post-metadata">

**Author:** ![johanr](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/johanr/32/39968_2.png) [@johanr](https://root-forum.cern.ch/u/johanr)\
**Post date:** [August 10, 2026, 4:05pm UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/3 "2026-08-10T16:05:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 10, 2026, 5:25pm UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/4 "2026-08-10T17:25:07Z")

</div>

Not needed, was just a pointer for developers.

Anyway, that JIRA report just mentions [Ubuntu Xenial cling interpreter terminal unicode problem - #8 by Axel](https://root-forum.cern.ch/t/ubuntu-xenial-cling-interpreter-terminal-unicode-problem/29609/8)

---

<div class="post-metadata">

**Author:** ![johanr](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/johanr/32/39968_2.png) [@johanr](https://root-forum.cern.ch/u/johanr)\
**Post date:** [August 10, 2026, 7:07pm UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/5 "2026-08-10T19:07:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 11, 2026, 11:26am UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/6 "2026-08-11T11:26:52Z")

</div>

Maybe this helps?

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

```

?

---

<div class="post-metadata">

**Author:** ![johanr](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/johanr/32/39968_2.png) [@johanr](https://root-forum.cern.ch/u/johanr)\
**Post date:** [August 11, 2026, 12:09pm UTC](https://root-forum.cern.ch/t/c-20-std-format-fails/64969/7 "2026-08-11T12:09:55Z")

</div>

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

```auto
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

```
