medis icon indicating copy to clipboard operation
medis copied to clipboard

UTF8 encoded

Open davidesigner opened this issue 3 years ago • 6 comments

Thanks for this new version of Medis. Many cool options availables!

The only regression from the 1st version is that UTF8 characters stay encoded...

The new one: Capture d’écran 2022-02-08 à 09 10 26

The version 1: Capture d’écran 2022-02-08 à 09 10 16

Is there anything to do to have human readable characters?

davidesigner avatar Feb 08 '22 08:02 davidesigner

Hey @davidesigner 👋

Thanks for using Medis! I can't reproduce this with 2.7.0. Are there any special chars that don't render properly?

CleanShot 2022-02-12 at 11 07 37@2x

luin avatar Feb 12 '22 03:02 luin

Hi @luin,

Thanks for your reply, sorry for my late reply...

My Redis documents are encoded:

{"id":"selection-e8667b64-4985-45e9-a960-3243c1dffd96","openedBlocks":["Informations importantes","Bien pr\u00e9parer votre s\u00e9jour","Suggestions de vols"]}

The first version of Medis display decoded characters when I choose the JSON format:

v1-raw v1-json

The new version for the same document:

v2-json

When I create a document from the GUI in the new version with UTF8 characters, all works well but you will understand that my documents are not written through the GUI...

davidesigner avatar Mar 31 '22 20:03 davidesigner

Sorry for the late response. According to the spec of JSON, it's valid to encode Unicode chars with \uxxxx. The difference between Medis 1 and 2 is that Medis 1 parses the \uxxxx code, while Medis 2 displays it as is. Comparing the two I prefer the behavior of Medis 2, which shows the original content of the database.

Let me know if that makes sense. Thanks for using Medis!

luin avatar Jun 06 '22 08:06 luin

I find it interesting that the "raw" format of the document is really raw and therefore not parsed. Especially to detect a bug or understand what is really stored.

When we display a JSON version, we are in a consultation / edition process. And at this moment, to see the pretty small sun ☀️ is more practical than to see \u2600.

Are you agree?

davidesigner avatar Jun 09 '22 08:06 davidesigner

What about adding an "encoding" selector defaulting to "raw" so the user can decide the behavior? Just like "Viewer" and "Formatter" selectors.

benjamindulau avatar Jun 09 '22 09:06 benjamindulau

@davidesigner @benjamindulau Yeah I think an option to toggle the behavior would be useful. Added to the roadmap.

luin avatar Jun 09 '22 10:06 luin

Hi @luin, thanks for your comment.

Where could we find the progress of this issue? Do you have any idea of the expected release date?

davidesigner avatar Dec 20 '22 15:12 davidesigner

Hey @davidesigner! Sorry for the slow progress! Will be released in the next version (within a month).

luin avatar Dec 22 '22 05:12 luin

Medis 2.zip

Here is a beta version and would be great if you have a chance to give it a try. There is a new option added in the preference settings.

luin avatar Dec 22 '22 11:12 luin

Thanks for the beta version @luin, what is this option you've added?

For information, when I try to switch to any default Encoders, I have the following message: Capture d’écran 2022-12-22 à 17 05 50

davidesigner avatar Dec 22 '22 16:12 davidesigner

CleanShot 2022-12-23 at 08 01 37@2x

It's on the Editor setting panel.

luin avatar Dec 23 '22 00:12 luin

Awesome (I didn't find it because I was using the bad version sorry), that's working great! Thanks @luin

davidesigner avatar Dec 23 '22 09:12 davidesigner