Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected]MB to Hacker [email protected] • 2 years ago

What it takes to pass a file path to a Windows API in C++

mastodon.gamedev.place

message-square
0
fedilink
  • cross-posted to:
  • [email protected]
  • [email protected]
3
external-link

What it takes to pass a file path to a Windows API in C++

mastodon.gamedev.place

@[email protected]MB to Hacker [email protected] • 2 years ago
message-square
0
fedilink
  • cross-posted to:
  • [email protected]
  • [email protected]
Ashley Gullen (@[email protected])
mastodon.gamedev.place
external-link
If you thought JavaScript was a mess, here's what it takes to pass a file path to a Windows API in C++: 🧵 - Windows uses UTF-16, but most modern software uses UTF-8 - Converting UTF-8 to UTF-16 requires calling MultiByteToWideChar twice (once for size, second to convert) - Alternatively you can set the process code page to UTF-8 and call the 'A' variant API directly, but only sometimes, and only with Windows 10 v1903+, and you might still have to change the system locale setting and reboot (1/3)

HN Discussion

alert-triangle
You must log in or register to comment.

Hacker [email protected]

[email protected]
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

A mirror of Hacker News’ best submissions.

  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 2 subscribers
  • 10.3K Posts
  • 2.76K Comments
  • Modlog
  • mods:
  • @[email protected]
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org