mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[PR #1340] [MERGED] Use UTF8 internally and convert to UTF16 at the edge. #1779
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#1779
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/debauchee/barrier/pull/1340
Author: @p12tic
Created: 10/29/2021
Status: ✅ Merged
Merged: 10/29/2021
Merged by: @p12tic
Base:
master← Head:use-utf8📝 Commits (3)
15a955fRevert "Use ansi codepage for internal multibyte strings on windows"8286c85lib/common/win32: Extract unicode_to_mb() to separate filed24f368Correctly open files with non-ASCII paths on Windows📊 Changes
21 files changed (+241 additions, -155 deletions)
View changed files
📝
src/gui/src/CommandProcess.cpp(+10 -11)📝
src/gui/src/Fingerprint.cpp(+5 -2)📝
src/gui/src/IpcClient.cpp(+5 -3)📝
src/gui/src/MainWindow.cpp(+2 -1)📝
src/gui/src/QUtility.cpp(+0 -9)📝
src/gui/src/QUtility.h(+0 -1)📝
src/gui/src/SslCertificate.cpp(+26 -21)📝
src/gui/src/SslCertificate.h(+4 -4)📝
src/lib/barrier/DropHelper.cpp(+2 -1)📝
src/lib/barrier/win32/DaemonApp.cpp(+1 -2)📝
src/lib/base/log_outputters.cpp(+2 -2)📝
src/lib/common/win32/DataDirectories.cpp(+17 -3)➖
src/lib/common/win32/KnownFolderPaths.cpp(+0 -63)➖
src/lib/common/win32/KnownFolderPaths.h(+0 -24)➕
src/lib/common/win32/encoding_utilities.cpp(+37 -0)➕
src/lib/common/win32/encoding_utilities.h(+28 -0)➕
src/lib/io/fstream.cpp(+57 -0)➕
src/lib/io/fstream.h(+35 -0)📝
src/lib/ipc/IpcLogOutputter.cpp(+1 -2)📝
src/lib/net/SecureSocket.cpp(+2 -1)...and 1 more files
📄 Description
On Windows the standard stream open() functions expect bytes encoded in current system encoding, not UTF8. Since we're dealing with UTF8 throughout the application this results in wrong paths being passed and failure to open files. As a solution, we convert the paths to UTF16 via the WCHAR character type and use the special Windows-specific overloads of open() functions.
Previous solution was making half of application to use local encodings which made the system hard to understand and very brittle.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.