Skip to content

modified status line hooks to avoid error:#21

Open
Rykarix wants to merge 1 commit into
disler:mainfrom
Rykarix:statusline-fix
Open

modified status line hooks to avoid error:#21
Rykarix wants to merge 1 commit into
disler:mainfrom
Rykarix:statusline-fix

Conversation

@Rykarix

@Rykarix Rykarix commented Sep 8, 2025

Copy link
Copy Markdown
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4c1' in position 12: character maps to
     <undefined>

```
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4c1' in position 12: character maps to
     <undefined>
```
@Rykarix

Rykarix commented Sep 8, 2025

Copy link
Copy Markdown
Author

You could probably create a small python library 'status_line' builder that handles all this properly ...

and maybe update the pr to not include a blind t/e like I've done like a noob dev but this will prolly be needed for some if not all windows users.

I use git bash natively on windows by default so if I'm an edgecase that might be why

For visibility this was the error I got:

  ⎿  Error: Traceback (most recent call last):
       File "C:\PyProj\.Examples\claude-code-hooks-mastery\.claude\status_lines\status_line.py", line 134, in main
         print(status_line)
         ~~~~~^^^^^^^^^^^^^
       File "C:\Users\admin\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\encodings\cp1252.py", line
     19, in encode
         return codecs.charmap_encode(input,self.errors,encoding_table)[0]
                ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4c1' in position 23: character maps to
     <undefined>

Other thoughts:

  • Could use rich, colorama or maybe even loguru / structlog as your output handlers. Official and well maintained libraries like these could potentially ensure better cross-compatability
  • Structlog might be a useful addition to your hooks for logging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant