Skip to content

Commit

Permalink
Add encoding=utf-8 option (#88)
Browse files Browse the repository at this point in the history
Add force encoding utf-8 option for "Convert from GeoJSON"
  • Loading branch information
yuhangch authored Jan 26, 2021
1 parent b7f7f09 commit e5191e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ exports.createServer = function (opts) {
ogr.skipfailures()
}

if ('forceUTF8' in req.body) {
ogr.options(['-lco', 'ENCODING=UTF-8'])
}

if (opts.timeout) {
ogr.timeout(opts.timeout)
}
Expand Down
1 change: 1 addition & 0 deletions views/home.pug
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ block body
li <code>jsonUrl</code> - the URL for a remote GeoJSON file
li <code>outputName</code> (optional) - the name for the resulting zip file
li <code>skipFailures</code> (optional) - skip failures
li <code>forceUTF8</code> (optional) - force utf-8
li <code>format</code> (optional) - File format supported by the <a href="https://github.com/wavded/ogr2ogr">ogr2ogr wrapper</a>

h3 Where can I watch the project status, report issues, contribute, or fork the code?
Expand Down
5 changes: 5 additions & 0 deletions views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ html
label
input(name="skipFailures", type='checkbox')
| Skip failures
.col-sm-9.col-sm-offset-3
.checkbox
label
input(name="forceUTF8", type='checkbox')
| Force UTF-8
.form-group
.col-sm-9.col-sm-offset-3
button.btn.btn-warning(name="convert") Convert to Shapefile
Expand Down

0 comments on commit e5191e4

Please sign in to comment.