Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected]
cake
MB to Hacker [email protected]English • 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]
2
external-link

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

mastodon.gamedev.place

@[email protected]
cake
MB to Hacker [email protected]English • 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)

There is a discussion on Hacker News, but feel free to comment here as well.

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]

This community serves to share top posts on Hacker News with the wider fediverse.

Rules
  1. Keep it legal
  2. Keep it civil and SFW
  3. Keep it safe for members of marginalised groups
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 1 subscriber
  • 16K Posts
  • 10.3K Comments
  • Modlog
  • mods:
  • @[email protected]
    cake
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org