d1vanov / quentier

Cross-platform desktop Evernote client
GNU General Public License v3.0
134 stars 16 forks source link

Texts of notes display incorrectly. #179

Closed forest71 closed 6 years ago

forest71 commented 6 years ago

I imported enex file from evernote to quentier but all texts of imported notes looks like this: http://prntscr.com/k4fw49

I noticed it happens only with texts in russian language.

How to fix this problem?

d1vanov commented 6 years ago

Thanks for reporting this! Could you please share the enex file with which the problem reproduces and also specify which version of Quentier you are using - platform (Linux, Windows or Mac), where it was installed from etc.

forest71 commented 6 years ago

Can't provide enex file right now, but you can reproduce this bug if you create a note in evernote with russian text, then export it to enex file and open it in Quentier .

Version of Quentier is 0.4.0 (Qt 5.10.1) Platform: Windows Setup file was downloaded from here: https://github.com/d1vanov/quentier Qt 5.10 64 bit installer

d1vanov commented 6 years ago

Thanks for the info, will try to look into this. I guess it is somehow connected with UTF-16 being the default encoding on Windows.

forest71 commented 6 years ago

Thanks, will wait for answer.

d1vanov commented 6 years ago

I haven't tried to reproduce this myself yet but I believe I see the reason of this issue from just looking through the code - it's a bug, I carelessly used platform-dependent string encoding instead of proper UTF-8 one. On Linux and Mac that encoding happens to actually be UTF-8 - the same encoding used by Evernote for ENEX files, so no issues should occur on those platforms. On Windows the default encoding is UTF-16, however, and thus any non-English text would be processed incorrectly when importing/exporting notes from/to ENEX.

The experimental fix is ready but I need to test it before applying it to the stable branch, so stay tuned.

forest71 commented 6 years ago

Ok, got it.

d1vanov commented 6 years ago

The build containing the fix is available now and can be downloaded from here. @forest71, if you wish, you can try this build and see if it fixes your issue. Unfortunately, the already imported notes would not be fixed but the newly imported ones should be displayed properly. I still haven't tested it myself yet.

There are two downloads at the link:

  1. SetupQuentier<...>.exe is the installer like the one you downloaded originally, it would replace the version you have installed now.
  2. Quentier-windows<...>.zip is the zip archive containing Quentier executable, libraries and other needed stuff. You can unzip it anywhere and run without installing for testing purposes.
forest71 commented 6 years ago

It worked. Now all texts display correctly, thanks.

  1. Where Quentier keeps imported files? Just in case I deleted previous version and installed (unziped) Quentier from zip archive. When I opened this zip version all previous imported notes were still there.

  2. When you update Quentier can you also upload portable version (just like Quentier from that archive)? It is very handy.

d1vanov commented 6 years ago

Great, thanks for verifying! Merged the fix to master and development branches, updated downloads will appear on releases page shortly.

  1. Quentier stores all notes, imported or synchronized or manually typed in a local storage database. All persistent storage of Quentier including the database is located in a separate folder, not near the executable. In case of Windows the folder where Quentier's persistent storage is located is C:\Users\%USERNAME%\AppData\Roaming\Quentier. So if you want to wipe all your storage out, you need to remove that folder. Alternatively, in your case you could delete the notes you imported previously: in case of local account permanent deletion is possible, in case of Evernote account you can't actually delete the note permanently via Quentier (Evernote disallows third party apps to do that) but you can mark it as deleted which would make it disappear from your notes list and appear within the deleted notes list. If that latter one is not displayed in the bottom of the left side panel of the app, toggle its display via "View" -> "Side panel" -> "Show deleted notes" menu entry. The notes marked as deleted can be restored from Quentier or Evernote and they can be deleted permanently but only via the official Evernote client or web version of Evernote.
  2. Yes, I guess it is possible to upload portable version to the releases page. I created #181 to do it carefully.
forest71 commented 6 years ago

Understood, thanks. There is something else.

I found several files in account folder: .sqlite .sqlite-shm .sqlite-wal folder "NoteEditorPage"

  1. If I understand correctly, all notes (as well as imported) stored in .sqlite file, right?

  2. What is the purpose of "NoteEditorPage" folder?

  3. Is it possible to do so that all notes will be stored in one folder with Quentier itself? Situation for example: if you want to move portable version of Quentier to flash drive, you need to move only one folder (that include Quentier and it's databases) instead of two (folder with Quentier and folder with it's databases).

d1vanov commented 6 years ago
  1. Yes, exactly. The two other sqlite files are just auxiliary ones managed by SQLite database itself.
  2. This folder contains some auxiliary files used by the note editor. It is merely an implementation detail in fact - the note editor is implemented as a web page and it needs a .html file to display the note + image files for stuff like note attachments + some other stuff.
  3. Yes, it is possible to change the storage folder, for that it's enough to run Quentier from command line with --storageDir <path> argument. On Windows you can put this argument into the properties of the label via which you start Quentier.
d1vanov commented 6 years ago

The information about the storage folder is actually explained in the beginning of this article about Quentier features. Given your question I conclude you haven't read it yet, so I encourage you to do so :smiley:

forest71 commented 6 years ago

Thanks, will do.