Ask coding questions

← Back to all posts
New replit database? Cannot delete current.
bankey

I added a couple of key/value pairs into my database in which some of the keys contained special characters, such as 'â' and I am unable to remove them via db.delete or db.empty() as they are throwing errors. I cannot list keys either as that also throws errors.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
bankey
Comments
hotnewtop
Coder100

yes
some of the official clients have failed to handle this, and the only way to fix it is to fork the repl, so the db is reset.

bankey

@Coder100 Perfect, thank you :)

Coder100

yeah sorry
np :)
mark as correct answer?

also another way you could fix it is using ord() and chr() next time @bankey

bankey

@Coder100 what do those do

Coder100

they give you the integer of the char and give you the char from the integer so then you can have those custom characters technically @bankey

EpicGamer007

Theres a pretty simple fix and that is to urlencode before putting in the db. For example in nodejs, you would do db.set("key", encodeURIComponent("valueâ")); then whenever you get back data, you decodeURIComponent((await db.get("key")))