Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| let r = | ||
| super::raster::add_named_bytes_read(s, p, name, bytes, b(p, "zoom"), super::raster::ByteRead { asked, ..Default::default() }) | ||
| .map_err(named)?; |
There was a problem hiding this comment.
layer.addUrl downloads a Shapefile, zip or .dbf address and hands the bytes to add_named_bytes_read with ByteRead { asked, .. }, so an encoding on that command is never read. layer.addUrl's spec does not declare encoding either, and unknown keys are ignored (layer.rs:5777). An encoding given for a URL is therefore dropped with no notice, and the text decodes with the .cpg or UTF-8 default. That is the silent wrong-text case this PR is meant to fix, and the URL route is a twin of layer.addDownload, which does pass it through.
Suggested fix: forward the encoding here, declare "encoding"? in the layer.addUrl params (then run cargo xtask commands), and add a regression test with a CP932 .dbf fetched by URL that checks the decoded text and the notice.
| let r = | |
| super::raster::add_named_bytes_read(s, p, name, bytes, b(p, "zoom"), super::raster::ByteRead { asked, ..Default::default() }) | |
| .map_err(named)?; | |
| let r = super::raster::add_named_bytes_read( | |
| s, | |
| p, | |
| name, | |
| bytes, | |
| b(p, "zoom"), | |
| super::raster::ByteRead { asked, encoding: dbf_encoding(p).as_deref(), ..Default::default() }, | |
| ) | |
| .map_err(named)?; |
Category: bug
| requires | ||
| } | ||
|
|
||
| fn command_uses_dbf_encoding(id: &str, params: &Value) -> bool { |
There was a problem hiding this comment.
command_uses_dbf_encoding sets the dbf-encoding requirement for any encoding on these three commands, including sources that ignore it (GeoJSON, GeoPackage, Parquet, a PNG). A saved script or macro with such a parameter then makes the project refused by older RustGIS even though nothing about it depends on the new reader. Only .shp, .dbf and .zip paths use the option (takes_dbf_encoding in layer.rs already defines that set), so the check could test the path too, or the requirement could follow Dataset::dbf_encoding alone, which the layer and table checks already cover.
Category: quality
Code reviewReviewed the whole diff (30 files) against Bugs
Security
Performance
Quality
AGENTS.md
Twins checked
Change sizeCompared with the base branch: the whole PR against main (merge base cc06db4 to PR head cdebb5c).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Shapefiles and dBASE tables without encoding metadata fall back to UTF-8. For a CP932 file, this can replace Japanese text with U+FFFD. Pass a code page name or number to
layer.addData,layer.addDataBytesorlayer.addDownloadto decode the text without writing a sidecar. RustGIS applies the override before the .cpg and language driver and still reports malformed bytes. Projects retain the choice, including when a linked Shapefile is reopened.layer.addDataBytes, and hosts can set it inlayer.addDownloadwhen completing a download. The phone uses the shared command handlers.add_data, Assistant and MCP use the shared command parameters. Plugins that can call these commands use the same parameters and existing command permissions.Testing
cargo xtask commandsandcargo xtask schema.UI evidence
Related issue
Maintainer-approved additive change.
Summary by CodeRabbit
New Features
Bug Fixes