Skip to content

fix: support hebrew characters in feature properties by adding UTF-8 encoding to shapefile reader#43

Merged
vitaligi merged 1 commit into
v3.xfrom
fix/support-hebrew-chars
Sep 16, 2025
Merged

fix: support hebrew characters in feature properties by adding UTF-8 encoding to shapefile reader#43
vitaligi merged 1 commit into
v3.xfrom
fix/support-hebrew-chars

Conversation

@almog8k
Copy link
Copy Markdown
Contributor

@almog8k almog8k commented Sep 11, 2025

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Further information:
support hebrew characters in feature properties by adding UTF-8 encoding to shapefile reader

@razbroc razbroc requested a review from Copilot September 11, 2025 14:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes support for Hebrew characters in shapefile feature properties by adding UTF-8 encoding to the shapefile reader. The change ensures that non-ASCII characters in DBF files are properly decoded when reading shapefiles.

  • Updated the shapefile reader to use UTF-8 encoding when opening shapefile and DBF files
  • Added DBF file path construction for proper encoding support
  • Updated corresponding test to verify the new encoding parameter

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/files/shapefile/core/shapeFileReader.ts Modified to construct DBF path and pass UTF-8 encoding to shapefile.open()
tests/unit/files/shapefile/shapeFileReader.spec.ts Updated test expectations to include DBF path and encoding parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

try {
const reader = await open(shapefilePath);
const dbfPath = shapefilePath.replace(/\.shp$/i, '.dbf');
//support feature properties with hebrew characters by setting encoding to 'utf-8'
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment should start with a capital letter and end with a period for consistency: '// Support feature properties with Hebrew characters by setting encoding to 'utf-8'.'

Suggested change
//support feature properties with hebrew characters by setting encoding to 'utf-8'
// Support feature properties with Hebrew characters by setting encoding to 'utf-8'.

Copilot uses AI. Check for mistakes.
Comment thread src/files/shapefile/core/shapeFileReader.ts
Copy link
Copy Markdown

@razbroc razbroc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@vitaligi vitaligi merged commit a329be5 into v3.x Sep 16, 2025
7 checks passed
@vitaligi vitaligi deleted the fix/support-hebrew-chars branch September 16, 2025 14:01
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.

5 participants