Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6019357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:24:37+00:00 2026-05-23T03:24:37+00:00

I’m writing some middleware that’s driving me nuts. I’m looking for some I18N experts

  • 0

I’m writing some middleware that’s driving me nuts. I’m looking for some I18N experts to help me out – this is all pretty new to me.

Right now this is all in Windows, but it will have to work on Linux and Mac too, though I bet those will be easy.

I have a system (that I can’t touch) that will give me a string that’s as a wchar_t*. It takes input in either UTF-8 or the current locale and does the magic to give me a wchar_t*.

I have another API that I’m using that can only take filenames as char* (That I also can’t touch).

So what I’ve been doing is taking my filename in wchar_t* and using the Windows API function WideCharToMultiByte and converting it to a char* and passing that to my other API function. It was working just fine until QA decided to use a Japanese OS. Now the fopen (deep inside the API that I can’t touch) is failing.

I’ve tried using both CP_ACP and CP_UTF8 in my WideCharToMultiByte call and both work on my development (US-English) machine even with Japanese characters in the filename. But both fail on the Japanese OS.

Any hints on how I should really be handling these filenames?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:24:38+00:00Added an answer on May 23, 2026 at 3:24 am

    Well, the correct way to fix this would be to fix the other API. Accepting only narrow, non-unicode filenames is simply broken behavior.

    But… you said you can’t do that. You might be able to work around this by getting the short file name, which will not have any non ANSI characters, and passing that to the broken API instead. (The reason for this is that short filenames are designed to work for 16 bit applications, and 16 bit windows didn’t support Unicode at all)

    Of course this will fail if the filename is not representable as a short file name, or if short file names are turned off on the target machine — but it’s really the only option here.

    EDIT: One more note — if the filename contains Unicode the short filename will generally not be human readable. It will be renamed to use a bunch of hex garbage which uniquely identifies the file in a world restricted to 8.3 filenames.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.