GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Parent Directory
  • unicodemod-code.png
  • unicodemod-usage.png
  • unicodemod.py

This view

  • Original page
  • New address

GeezerVison is showing learning-python.com — Index of /unicodemod

Index of /unicodemod

  • Parent Directory
  • unicodemod-code.png
  • unicodemod-usage.png
  • unicodemod.py

This script converts a text file from an old Unicode encoding to a new Unicode encoding (e.g., from 'latin1' or 'utf16', to 'utf8' or 'latin-1'), changing the text file in-place. Parameters are input in the console window, unless all are provided.

This originally appeared in frigcal (where it has additional examples, and serves as a utility for ".ics" calendar files), but it can be applied to any type of text file.

Alternative: the PyEdit text editor lets you Open in one Unicode encoding, and SaveAs in another. The script here may be more useful in command-line and batch roles.



[Home page] Books Code Blog Python Author Training Search ©M.Lutz
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.