[GH-ISSUE #14475] Output redirected to a file in PowerShell has encoding issues #9387

Open
opened 2026-04-12 22:18:21 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ggruen on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14475

What is the issue?

When running in Windows PowerShell (version 5.1 on Windows 11 Pro), output containing non-ASCII characters that's redirected into a file (e.g., with ">" or "Out-File") appears as garbled three-character strings when the file is viewed in an editor (e.g., Notepad). The same output appears as expected if sent directly to the terminal and not redirected.

To reproduce:

  • In PowerShell, run a command that sends output to a file, e.g.,:

    ollama run gemma3:4b "Output Hi there, this here's a Unicode endash–containing file." > unicode_ollama_test.txt

  • Open the file in Notepad.

Expected result:

  • The file contains "Hi there, this here's a Unicode endash–containing file`."

Actual result:

  • The file contains "Hi there, this here's a Unicode endashΓÇôcontaining file."

Notes:

  • There's a similar issue here that was supposedly resolved in 2024: https://github.com/ollama/ollama/issues/3826
  • The issue appears with multiple models.
  • The same command produces the expected result on macOS.
  • Smart quotes and apostrophes (which occur frequently in model output) are also affected. I used the endash as an example because it's easy to type into PowerShell on Windows.

Relevant log output


OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.17.0

Originally created by @ggruen on GitHub (Feb 26, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14475 ### What is the issue? When running in Windows PowerShell (version 5.1 on Windows 11 Pro), output containing non-ASCII characters that's redirected into a file (e.g., with ">" or "Out-File") appears as garbled three-character strings when the file is viewed in an editor (e.g., Notepad). The same output appears as expected if sent directly to the terminal and not redirected. To reproduce: - In PowerShell, run a command that sends output to a file, e.g.,: ollama run gemma3:4b "Output `Hi there, this here's a Unicode endash–containing file`." > unicode_ollama_test.txt - Open the file in Notepad. Expected result: - The file contains "Hi there, this here's a Unicode endash–containing file`." Actual result: - The file contains "Hi there, this here's a Unicode endashΓÇôcontaining file." Notes: - There's a similar issue here that was supposedly resolved in 2024: https://github.com/ollama/ollama/issues/3826 - The issue appears with multiple models. - The same command produces the expected result on macOS. - Smart quotes and apostrophes (which occur frequently in model output) are also affected. I used the endash as an example because it's easy to type into PowerShell on Windows. ### Relevant log output ```shell ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.17.0
GiteaMirror added the bug label 2026-04-12 22:18:21 -05:00
Author
Owner

@cheryei commented on GitHub (Mar 2, 2026):

怎么搭建自己的智能体团队呢?
我想让多个员工(智能体)同时给我干活。彼此之间懂得以协作
Image

<!-- gh-comment-id:3982232744 --> @cheryei commented on GitHub (Mar 2, 2026): 怎么搭建自己的智能体团队呢? 我想让多个员工(智能体)同时给我干活。彼此之间懂得以协作 <img width="897" height="600" alt="Image" src="https://github.com/user-attachments/assets/963c0c88-4e6b-40fc-8bd2-e640c2886127" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9387