jetwhiz / encfs4win

Windows port of EncFS
https://encfs.win
Other
400 stars 41 forks source link

Encfsctl handles nordic characters incorrectly #79

Open NiklasThunvik opened 7 years ago

NiklasThunvik commented 7 years ago

Environment

Description

When trying to encode/decode paths with nordic characters they get mangled by encfsctl. They do work when mounting using encfs though.

Expected behavior vs. actual behavior

encfs and encfsctl should encode paths in the same way. Now they don't.

Mounted drive encodes path "/ÅÄÖ" as "3my7AtPXTpUFz6HqAn-1zESJ". Trying to encode the same path using encfsctl returns "X6F60-PunHHH0CUQ5Onw906Z"

Using encfsctl to decode "3my7AtPXTpUFz6HqAn-1zESJ" returns "├à├ä├û" Using encfsctl to decode the path returned by itself "X6F60-PunHHH0CUQ5Onw906Z" returns "┼─Í"

Steps to reproduce problem

  1. Mount a drive
  2. Create a folder named "ÅÄÖ"
  3. Take the encoded name and try to decode it using encfsctl OR
  4. Try to encode the same path using encfsctl and the encoded paths should match.

Relevant logs

Attach any relevant log files that can help to debug your issue (be sure to use the -v option for verbose logs).

jetwhiz commented 7 years ago

Hi @NiklasThunvik -- thanks for the bug report!

Is this issue specific to encfsctl, or does it also exist in encfs?

NiklasThunvik commented 7 years ago

It seems to be specific to encfstl. Encfs behaves correctly.

jetwhiz commented 7 years ago

It might be as simple as adding "SetConsoleCP(65001);" to set the console to uft-8 here: https://github.com/jetwhiz/encfs4win/blob/master/encfs/encfsctl.cpp#L756

int main(int argc, char **argv) {
  SetConsoleCP(65001);

  encfs::init_mpool_mutex();

  START_EASYLOGGINGPP(argc, argv);
  encfs::initLogging();

We'll have to see how this impacts decode and encode though. Can you see if this fixes your issue?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.