Python Forum
[SOLVED] [Windows] Converting filename to UTF8?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] [Windows] Converting filename to UTF8?
#6
(Sep-06-2022, 10:30 PM)Winfried Wrote: t's displayed fine in Notepad++.

I can live with chardetect misdetecting the encoding.
Sure if working there is no problem.
Some tips when in Notepad++ most remember to save file not only display it.
Remember define encoding(utf-8) in Python both when take file in and save it out from Python,if not so can Windows mess it up and guess on wrong encoding
So in code i post #2, then file in from OS and out after Python is utf-8.
# In from OS
G:\div_code\answer
λ chardetect pla.kml
pla.kml: utf-8 with confidence 0.99

# Out put from Python
G:\div_code\answer
λ chardetect pla_out.kml
pla_out.kml: utf-8 with confidence 0.99
Reply


Messages In This Thread
RE: [SOLVED] [Windows] Converting filename to UTF8? - by snippsat - Sep-06-2022, 10:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] [Windows] Fails reading strings with accents Winfried 1 875 Apr-23-2023, 05:27 PM
Last Post: Larz60+
  [SOLVED] [Windows] Right way to prompt for directory? Winfried 4 2,117 Jan-17-2023, 09:28 PM
Last Post: markoberk
  Who converts data when writing to a database with an encoding different from utf8? AlekseyPython 1 2,403 Mar-04-2019, 08:26 AM
Last Post: DeaD_EyE
  Want a list utf8 formatted but bytestrings found nikos 28 11,666 Feb-18-2019, 08:26 AM
Last Post: nikos
  SOLVED: best way to block (wait on) shell calls to multiple windows programs at once? ezdev 0 2,629 Dec-10-2017, 06:42 AM
Last Post: ezdev
  [?] UTF8, Unicode and Binary data reading troubles doublezero 1 3,195 Mar-31-2017, 11:32 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020