ankidroid / ankidroid/Anki-Android

Exporting a deck as plain text fails if the deck name contains a slash

Open
#21,591 3 comments 0 reactions 1 assignee Claimed by @CapThunder19 View on GitHub
Needs Triage
Dominant language
Kotlin
Stars
11.8k
Forks
2.9k
Avg merge
2d 3h
Merged PRs (30d)
171

Description

### Checked for duplicates?

- [x] This issue is not a duplicate

### Does it also happen in the desktop version?

- [ ] This bug does not occur in the latest version of Anki Desktop

### What are the steps to reproduce this bug?

1. Create a deck with a "/" in its name, e.g. hi/test
2. Add card to it
3. on Deck Picker long-press the deck and then Export the deck
4. Set "Export format" to "Notes in Plain Text (.txt)"
5. Tap Export

The export fails with an error and no file is produced

Two things that narrow it down:
- The same deck exports fine as "Anki Deck Package (.apkg)"
- Renaming the deck to Der_Die_Das makes the .txt export work

"Cards in Plain Text (.txt)" fails in the same way

### Expected behaviour

What happened: the export failed with an IO error, no file was created

Image

What should have happened: the deck exports to a .txt file, with the slash
handled in the generated filename the same way the .apkg export already
handles it

### Debug info

```text
AnkiDroid Version = 2.24.0 (ebcf8e0e34921628b9b8a496c66ffd4adbb3705f)
Backend Version = 0.1.64-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 15 (SDK 35)
ProductFlavor = play
Device Info = OPPO | OPPO | OP574FL1 | CPH2577 | CPH2577 | mt6768
WebView Info = [com.google.android.webview | 792208303]: Mozilla/5.0 (Linux; Android 15; CPH2577 Build/AP3A.240617.008; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/151.0.7922.83 Mobile Safari/537.36
ACRA UUID = e76ebe42-1f6f-4830-ac63-426b439fda94
FSRS = 5.1.0 (Enabled: false)
Crash Reports Enabled = true
```

### (Optional) Anything else you want to share?

_No response_

### Research

- [x] I have checked the [manual](https://docs.ankidroid.org/) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/FAQ) and could not find a solution to my issue
- [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release ([instructions](https://docs.ankidroid.org/manual.html#betaTesting))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.