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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:49:07+00:00 2026-05-29T08:49:07+00:00

Can I make all std::string in my application support Unicode with Boost.Locale? After reading

  • 0

Can I make all std::string in my application support Unicode with Boost.Locale? After reading the documentation I can say yes. But I don’t understand how it works. The main question is can I still use boost string algorithms library or Boost.Lexical_Cast libraries? If yes, why I need boost::locale::to_upper and similar format methods, if I have these methods in boost string algorithm library.

  • 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-29T08:49:08+00:00Added an answer on May 29, 2026 at 8:49 am

    Yes, you can make all strings in your application Unicode encoded with Boost.Locale.

    To make it work you imbue the locale into the string, or set the default global locale to your new unicode-based locale (generated by Boost.Locale).
    See here for how to do that: http://www.boost.org/libs/locale/doc/html/locale_gen.html
    and http://www.boost.org/libs/locale/doc/html/faq.html

    The string manipulation APIs in Boost.Locale are different to the ones provided in the Boost string algorithm library.
    See here for why the Boost.Locale functions are better: http://www.boost.org/libs/locale/doc/html/conversions.html

    You can still use boost::lexical_cast, provided you set the global locale correctly (as, if I recall correctly, you can’t explicitly pass a locale object to Boost.LexicalCast).

    Keep in mind however that this will ‘break’ some cases, for example, when converting an integer to a string, instead of using the C locale (as was probably your previous default), it will use a different one, which may insert separators etc. When doing conversions that are NOT displayed to the user, you may wish to use std::stringstream et al directly to avoid these unwanted formatting changes.

    I highly suggest you read the Boost.Locale documentation in full, as it should address most of your concerns (especially the FAQ, generation backend information, etc.).

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

Sidebar

Related Questions

I have: void add_all_msgs(std::deque<Message>::iterator &iter); How can I make that function generic, so it
All I can make out is that one of them is the BC for
How can I make a style have all of the properties of the style
how can I make this jquery script close all previously opened children when entering
How can you make the experience with Eclipse faster? For instance: I disable all
Can someone help me figure out the following make file? BINS=file1 file2 file3 all:
We'd like to make a few basic hook scripts that we can all share
I can make an std::ostream object output integer numbers in hex, for example std::cout
In my application I have to constantly convert string between std::string and std::wstring due
I have a std::vector<std::string> of all the files in a directory: // fileList folder/file1

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.