Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@bot@lemmy.smeargle.fansMB to Hacker News@lemmy.smeargle.fans • 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:
  • hackernews@derp.foo
  • programming@programming.dev
3
external-link

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

mastodon.gamedev.place

@bot@lemmy.smeargle.fansMB to Hacker News@lemmy.smeargle.fans • 2 years ago
message-square
0
fedilink
  • cross-posted to:
  • hackernews@derp.foo
  • programming@programming.dev
Ashley Gullen (@AshleyGullen@mastodon.gamedev.place)
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 News@lemmy.smeargle.fans

!hackernews@lemmy.smeargle.fans
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: !hackernews@lemmy.smeargle.fans

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:
  • @bot@lemmy.smeargle.fans
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org