utils: Make fs::path::string() always return utf-8 string on Windows #13877

pull ken2812221 wants to merge 1 commits into bitcoin:master from ken2812221:fs-path-utf8 changing 4 files +6 −6
  1. ken2812221 commented at 4:43 PM on August 4, 2018: contributor

    Imbue fs::path with std::codecvt_utf8_utf16 at SetupEnvironment(), so that default string encoding will be utf-8 inside fs::path.

  2. ken2812221 cross-referenced this on Aug 4, 2018 from issue Filename and command line encoding issue on Windows by ken2812221
  3. ken2812221 force-pushed on Aug 4, 2018
  4. ken2812221 renamed this:
    utils: Make fs::path::string() always return utf-8 string
    utils: Make fs::path::string() always return utf-8 string on Windows
    on Aug 4, 2018
  5. DrahtBot commented at 8:13 PM on August 4, 2018: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:

    • #14123 (gui: Add GUIUtil::bringToFront by promag)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. DrahtBot cross-referenced this on Aug 4, 2018 from issue Test for Windows encoding issue by ken2812221
  7. DrahtBot cross-referenced this on Aug 4, 2018 from issue [bugfix] Fix encoding issue for Windows by ken2812221
  8. ken2812221 force-pushed on Aug 4, 2018
  9. ken2812221 renamed this:
    utils: Make fs::path::string() always return utf-8 string on Windows
    wip, utils: Make fs::path::string() always return utf-8 string on Windows
    on Aug 5, 2018
  10. DrahtBot cross-referenced this on Aug 5, 2018 from issue utils: drop boost::interprocess::file_lock by ken2812221
  11. ken2812221 renamed this:
    wip, utils: Make fs::path::string() always return utf-8 string on Windows
    utils: Make fs::path::string() always return utf-8 string on Windows
    on Aug 5, 2018
  12. ken2812221 force-pushed on Aug 5, 2018
  13. ken2812221 force-pushed on Aug 5, 2018
  14. ken2812221 force-pushed on Aug 5, 2018
  15. ken2812221 force-pushed on Aug 5, 2018
  16. ken2812221 force-pushed on Aug 5, 2018
  17. laanwj added the label Windows on Aug 6, 2018
  18. laanwj added the label Utils/log/libs on Aug 6, 2018
  19. ken2812221 force-pushed on Aug 24, 2018
  20. in src/util.cpp:61 in 26d6fe4a10 outdated
      57 | @@ -58,6 +58,7 @@
      58 |  #ifndef NOMINMAX
      59 |  #define NOMINMAX
      60 |  #endif
      61 | +#include <codecvt>
    


    NicolasDorier commented at 2:10 AM on August 31, 2018:

    maybe include only if WIN32?


    ken2812221 commented at 2:44 PM on August 31, 2018:

    OK. But I'll wait for gitian build done.


    ken2812221 commented at 7:02 AM on September 6, 2018:

    This is already be defined only if WIN32. Forgot about this


    MarcoFalke commented at 6:38 PM on September 22, 2018:

    Previously applied patch detected.

    Needs rebase?


    ken2812221 commented at 7:45 PM on September 22, 2018:

    Rebased

  21. MarcoFalke added the label Needs gitian build on Aug 31, 2018
  22. DrahtBot cross-referenced this on Aug 31, 2018 from issue gui: Add GUIUtil::bringToFront by promag
  23. DrahtBot removed the label Needs gitian build on Sep 2, 2018
  24. NicolasDorier commented at 5:49 AM on September 6, 2018: contributor

    Done quick code review (on other commits as well), seems ok, I will test more deeply later this week. Very excited about this.

  25. in src/qt/guiutil.cpp:63 in 26d6fe4a10 outdated
      61 | @@ -62,8 +62,6 @@
      62 |  #include <QFontDatabase>
      63 |  #endif
      64 |  
      65 | -static fs::detail::utf8_codecvt_facet utf8;
    


    ken2812221 commented at 7:06 AM on September 6, 2018:

    Drop this because this convert between UTF-8 and UCS-2, not UTF-16. Use std::codecvt_utf8_utf16 instead.


    ryanofsky commented at 10:46 PM on September 6, 2018:

    Drop this because this convert between UTF-8 and UCS-2, not UTF-16. Use std::codecvt_utf8_utf16 instead.

    This is documented at https://www.boost.org/doc/libs/1_68_0/boost/detail/utf8_codecvt_facet.hpp, in case anybody else is curious.

  26. ryanofsky approved
  27. ryanofsky commented at 10:47 PM on September 6, 2018: contributor

    utACK 26d6fe4a10c2c8cd16303835dd7cd5289f2d3b67

  28. in src/qt/guiutil.cpp:765 in 26d6fe4a10 outdated
     778 | @@ -781,12 +779,12 @@ void setClipboard(const QString& str)
     779 |  
     780 |  fs::path qstringToBoostPath(const QString &path)
     781 |  {
     782 | -    return fs::path(path.toStdString(), utf8);
     783 | +    return fs::path(path.toStdString());
    


    laanwj commented at 9:51 AM on September 13, 2018:

    doesn't this break support for non-UTF8 path locales on UNIX? (that's why this code was how it was, AFAIK)


    ken2812221 commented at 10:00 AM on September 13, 2018:

    laanwj commented at 12:29 PM on September 13, 2018:

    strange… (I don't think it was added for windows back in the day, but I might be misremembering)


    ken2812221 commented at 12:36 PM on September 13, 2018:

    @laanwj You only mention about Windows in #3935

  29. ken2812221 cross-referenced this on Sep 14, 2018 from issue utils: Add fstream wrapper to allow to pass unicode filename on Windows by ken2812221
  30. bitcoin deleted a comment on Sep 14, 2018
  31. ryanofsky commented at 6:32 PM on September 21, 2018: contributor

    Done quick code review (on other commits as well), seems ok, I will test more deeply later this week. Very excited about this. @NicolasDorier, are you still planning on testing this? If not, I think it would be good to get this merged since #13878 depends on it.

    Note to reviewers: even though fix here is pretty esoteric, it should be hopefully should be clear that it doesn't effect anything other than fs::path encodings used on windows.

  32. MarcoFalke added this to the milestone 0.18.0 on Sep 21, 2018
  33. MarcoFalke added the label Needs gitian build on Sep 21, 2018
  34. DrahtBot commented at 1:13 PM on September 22, 2018: contributor

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds for commit 920c090f63f4990bf0f3b3d1a6d3d8a8bcd14ba0 (master):

    Gitian builds for commit af0794a4f1e0a892780150c6069154f8327cb1e2 (master and this pull):

  35. DrahtBot removed the label Needs gitian build on Sep 22, 2018
  36. Make fs::path::string() always return utf-8 string 2c3eade704
  37. ken2812221 force-pushed on Sep 22, 2018
  38. MarcoFalke commented at 8:30 PM on September 22, 2018: member

    utACK 2c3eade704f63b360926de9e975ce80143781679 (Only checked that this does't affect linux)

  39. laanwj commented at 11:33 AM on September 23, 2018: member

    utACK 2c3eade704f63b360926de9e975ce80143781679

  40. MarcoFalke merged this on Sep 25, 2018
  41. MarcoFalke closed this on Sep 25, 2018

  42. MarcoFalke referenced this in commit cc7258bdfb on Sep 25, 2018
  43. ken2812221 deleted the branch on Sep 25, 2018
  44. Bushstar cross-referenced this on Oct 11, 2018 from issue Updates from bitcoin/master by Bushstar
  45. ken2812221 cross-referenced this on Oct 18, 2018 from issue Use utf-8 to decode filename by ken2812221
  46. ryanofsky cross-referenced this on Dec 14, 2018 from issue Error when running gmake check on NetBSD 8.0 by fanquake
  47. Warrows referenced this in commit fbec2557ef on Oct 14, 2019
  48. Warrows referenced this in commit d88bdc5aaa on Nov 23, 2019
  49. furszy cross-referenced this on Jun 24, 2021 from issue Solve filename and command line encoding issues on Windows by furszy
  50. Munkybooty referenced this in commit 21b3d1556d on Jul 10, 2021
  51. Munkybooty referenced this in commit f6d9b44801 on Jul 10, 2021
  52. Munkybooty referenced this in commit 7f1c2c0d89 on Jul 11, 2021
  53. Munkybooty referenced this in commit aa5cb13a18 on Jul 12, 2021
  54. Munkybooty referenced this in commit 7de0b07a92 on Jul 12, 2021
  55. Munkybooty referenced this in commit 4749c7e566 on Jul 13, 2021
  56. Munkybooty referenced this in commit e8c2117b16 on Jul 13, 2021
  57. UdjinM6 referenced this in commit 6aea99094b on Jul 13, 2021
  58. random-zebra referenced this in commit 61a098a775 on Aug 5, 2021
  59. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC