diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index 3912fd803..8bba9241e 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -158,6 +158,9 @@ namespace void trim_path_element(std::string& path_element) { + // on windows, NAME_MAX refers to Unicode characters + // on linux it refers to bytes (utf-8 encoded) + // TODO: Make this count Unicode characters instead of bytes on windows if (path_element.size() > NAME_MAX) { // truncate filenames that are too long. But keep extensions!