Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character encoding issue in ical.py on Windows #53

Closed
elliot-100 opened this issue Jan 11, 2023 · 3 comments
Closed

Character encoding issue in ical.py on Windows #53

elliot-100 opened this issue Jan 11, 2023 · 3 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@elliot-100
Copy link
Collaborator

elliot-100 commented Jan 11, 2023

After applying fix #52 for issue #51:

C:\Users\Elliot\AppData\Local\pypoetry\Cache\virtualenvs\spond-4LxEsJ8S-py3.7\Scripts\python.exe C:\Users\Elliot\dev\Olen-Spond\ical.py
Traceback (most recent call last):
  File "C:\Users\Elliot\dev\Olen-Spond\ical.py", line 44, in <module>
    asyncio.run(main())
  File "C:\Users\Elliot\AppData\Local\Programs\Python\Python37\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Users\Elliot\AppData\Local\Programs\Python\Python37\lib\asyncio\base_events.py", line 587, in run_until_complete
    return future.result()
  File "C:\Users\Elliot\dev\Olen-Spond\ical.py", line 38, in main
    out_file.writelines(c)
  File "C:\Users\Elliot\AppData\Local\Programs\Python\Python37\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 8-11: character maps to <undefined>

Assume one or more fields in my personal Spond data contain non-ASCII characters; similar issues likely in other scripts.
It would be good to set up a standard dataset for testing this and similar issues.

@elliot-100 elliot-100 added the bug Something isn't working label Jan 11, 2023
@Olen
Copy link
Owner

Olen commented Jan 15, 2023

I think it handles unicode (utf8) in calendars - i definitely have non-ascii characters in many of my events), but if yu run this on windows, you might be using some other charset locally which might cause issues?

@elliot-100
Copy link
Collaborator Author

Ah a bit of searching says you are right! Looks like it's trying to encode a glyph that isn't in the Windows 1252 character set. I need to isolate but suspect it's an emoji...

@elliot-100 elliot-100 changed the title Unicode handling issue in ical.py Unicode handling issue in ical.py on Windows Jan 16, 2023
@elliot-100 elliot-100 changed the title Unicode handling issue in ical.py on Windows Character encoding issue in ical.py on Windows Jan 16, 2023
@elliot-100 elliot-100 added the wontfix This will not be worked on label Feb 8, 2023
@elliot-100 elliot-100 self-assigned this Feb 8, 2023
@elliot-100
Copy link
Collaborator Author

I'm going to close this at it's frankly too obscure to worry about. It might ultimately be better to put a disclaimer about Windows in the README, I'll keep the somewhat similar #36 open as it can be simply fixed when I get round to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants