Skip to content

Commit

Permalink
fix: decode media names before inserting into the database
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil06012002 committed Feb 25, 2025
1 parent 7133b31 commit fb3eec3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/NoteEditor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,8 @@ class NoteEditor :

private fun updateField(field: FieldEditText?): Boolean {
val fieldContent = field!!.text?.toString() ?: ""
val correctedFieldContent = NoteService.convertToHtmlNewline(fieldContent, shouldReplaceNewlines())
// Decode the file name when preparing data for saveNote() to handle special characters correctly
val correctedFieldContent = Uri.decode(NoteService.convertToHtmlNewline(fieldContent, shouldReplaceNewlines()))
if (editorNote!!.values()[field.ord] != correctedFieldContent) {
editorNote!!.values()[field.ord] = correctedFieldContent
return true
Expand Down

0 comments on commit fb3eec3

Please sign in to comment.