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

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support for getting encoding from .cpg files · Issue #247 · GeospatialPython/pyshp

Support for getting encoding from .cpg files #247

New issue
Copy link
New issue
Copy link
Closed
Closed
Support for getting encoding from .cpg files#247
Copy link
Labels
enhancement
Milestone
Add support for additional non-standard metadata files

Description

@karimbahgat
karimbahgat
opened on Jul 26, 2022
Issue body actions

Describe the feature request

Non-standard but commonly accepted cpg file that specifies which text encoding to use. Would make for more robust handling of files and special cases. Main problem is figuring out which strings are used to represent encodings, appears to be non-standard.

May want to support both read and write support for this.

Contributions

  • I am interested in implementing the described feature request and submit as a PR.

Activity

  1. karimbahgat
    added
    enhancement
    on Jul 26, 2022
  2. karimbahgat
    added this to the Add support for additional non-standard metadata files milestone on Jul 26, 2022
  3. JamesParrott commented on Oct 18, 2022

    @JamesParrott
    JamesParrott
    on Oct 18, 2022
    Collaborator
    More actions

    I'm not familiar with arc, but from googling, .cpg files do seem to be nothing more than one line text files. However their very nature does invite the following questions:

    Are the .cpg files themselves encoded in utf-8, or what?
    Or do all the encoding strings to be supported only use ascii characters, so it shouldn't matter if it's not utf-16?

  4. karimbahgat commented on Jan 10, 2023

    @karimbahgat
    karimbahgat
    on Jan 10, 2023
    CollaboratorAuthor
    More actions

    Not sure at the moment, I suspect using ascii or utf8 would be a safe assumption and work in most cases. I haven't looked very hard though. Let me know if you find out, or want to submit a PR :)

  5. JamesParrott commented on Jul 25, 2026

    @JamesParrott
    JamesParrott
    on Jul 25, 2026
    Collaborator
    More actions

    Completed by #441, released in 3.1.6.

    Tested with the latin1 shapefile (and anecdotally with a UTF16 shapefile from QGIS). Round trip tests to be added later (possibly with support for optionally writing .cpg files).

  6. JamesParrott
    closed this as completedon Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    No projects

      Milestone

      • Add support for additional non-standard metadata filesNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.