Skip to content

Commit

Permalink
Merge pull request #58 from arduino/bugfix/non-ascii-filenames
Browse files Browse the repository at this point in the history
Bugfix/non ascii filenames
  • Loading branch information
ubidefeo authored Jul 7, 2023
2 parents 4ba5831 + 55ceed8 commit 9dedd05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"license": "MIT",
"dependencies": {
"about-window": "^1.15.2",
"micropython.js": "github:arduino/micropython.js#v1.4.1"
"micropython.js": "github:arduino/micropython.js#v1.4.2"
},
"engines": {
"node": "18"
Expand Down
6 changes: 2 additions & 4 deletions ui/arduino/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function store(state, emitter) {
let editor = state.cache(AceEditor, 'editor').editor
let contents = cleanCharacters(editor.getValue())
editor.setValue(contents)
let filename = state.selectedFile || 'undefined'
let filename = cleanCharacters(state.selectedFile || 'undefined')
let deviceName = getDeviceName(state.selectedDevice)

state.blocking = true
Expand Down Expand Up @@ -511,7 +511,7 @@ function store(state, emitter) {
})
emitter.on('save-filename', async (filename) => {
log('save-filename', filename)

filename = cleanCharacters(filename)
// no changes
if (state.selectedFile === filename) {
state.isEditingFilename = false
Expand Down Expand Up @@ -685,8 +685,6 @@ function resizeEditor(state) {
}
}



function cleanCharacters(str) {
return str.replace(/[\u{0080}-\u{FFFF}]/gu,"")
}
Expand Down

0 comments on commit 9dedd05

Please sign in to comment.