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 8387593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:15:19+00:00 2026-06-09T18:15:19+00:00

I have my C++ iOS game engine ported to Android, and it works fine

  • 0

I have my C++ iOS game engine ported to Android, and it works fine on the device back to Android 2.2, but I’m running into an issue when it comes to supporting localisation.

The C++ engine loads in .po (gettext) localisation files created using poedit and puts them into a std::wstring. This works absolutely fine on the other platforms I support, but doesn’t work on Android since the NDK doesn’t support wchar/wstring properly. See github for my current (very basic) implementation.

Now, I guess I can manually convert from a multibyte string to a custom defined std::basic_string<uint_32>. As suggested in – Android NDK C++ 'wstring' support

And that would be fine for the most part, but how are people handling string formatting? Though the majority of my strings are just text without any formatting required, some are along the lines of “Well done %1$s, you scored %2$d!“.

How are people handling formatting these strings without swprintf support?

Is there a recommended way to reliably handle cross platform localisation without relying on wchar/wstring support (which I gather isn’t recommend anyway – but no-one seems to suggest a viable alternative that doesn’t rely on 20MB+ libraries that are unsuitable for mobile)?

Many thanks.

  • 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-06-09T18:15:21+00:00Added an answer on June 9, 2026 at 6:15 pm

    I’ve managed to get this to work. Rather than using wide strings throughout the app I’ve converted it to use UTF8 throughout. This allows me to use sprintf as normal (with certain exceptions of course, like capping string lengths that won’t work). I’m then converting the strings to UTF32 within the font renderer so I don’t have to decode UTF8 on the fly.

    The implementation has just been uploaded to github for the localisation and font renderer

    References

    Unicode usage in video games
    UTF8 everywhere

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

Sidebar

Related Questions

I'm making a multiplayer iOS game and have run into the following issue: i
I have implemented in-app in my iOS game. The in-app works, but every time
I'm writing a little cross platform game engine for iOS, Android and BADA. I
I am creating a hybrid iOS/android game using cocos2d-x as the game engine. in
I'm writing an iOS game that draws many cubes on screen, but I have
I have developed a ios game with 20 levels. I have menu at starting
I am working on a game for iOS and I have to schedule an
I am working on a cross-platform mobile game for Android and iOS devices. I
Possible Duplicate: Determine device (iPhone, iPod Touch) with iOS I am making a game
Please provide me some iOS game development documentation for beginners. I do already have

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.