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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:22:15+00:00 2026-06-11T10:22:15+00:00

In my app I have to use CORBA::WChar* (or equivalent wchar_t*) but my program

  • 0

In my app I have to use CORBA::WChar* (or equivalent wchar_t*) but my program also needs to save some information to the PostgreSQL database. To insert data to PostgreSQL in C++ I use SOCI. And there’s the problem because :

The following types are currently supported for use with into and use expressions:
char (for character values)
short, int, unsigned long, long long, double (for numeric values)
char*, char[], std::string (for string values)
std::tm (for datetime values)
soci::statement (for nested statements and PL/SQL cursors)
soci::blob (for Binary Large OBjects)
soci::row_id (for row identifiers)

so theres no wchar_t* or wstring supported … and I need to convert CORBA::WChar (or wchar_t or wchar_t*) to string. How to do this?

I also have problem with wide chars (and strings), using CodeBlocks 10.5 :

#include <cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char **argv)
{
    const wchar_t *val = L"ąśżźćłóń";
    wcout << val << "\n";
    return 0;
}

shows:

E:\Temp\Untitled1.cpp||In function 'int main(int, char**)':|
E:\Temp\Untitled1.cpp|7|error: converting to execution character set: Invalid argument|
||=== Build finished: 1 errors, 0 warnings ===|

how to fix it?

I also need the code to be portable, that I can run it both on unix/linux and windows.

  • 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-11T10:22:16+00:00Added an answer on June 11, 2026 at 10:22 am

    I would suggest boost::locale::conv::utf_to_utf<char>(wchar_t*) that simply convert you wchar_t* string into UTF-8 for more information please read boost::locale documentation

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

Sidebar

Related Questions

in my app I have some text.setTextColor(Color.GRAY) . Now I would like to use
I have an app that needs to be able use either an sqlite3 datebase
I have an ASP.NET MVC App, which use EF code First, for some reason
I have a corba releated question. In my Java app I use typedef sequence
I have to develop web2py app and have to use Facebook sdk in that.
I am working on an android app and have to use remote database for
I found here that to restore brightness on app exit you have to use
I want to use mysql with a rails app (I have never used mysql
Anytime i change my in-app-settings (with shared preferences) i have to use the back
I have WinForms app and multiple forms and want to use ErrorProvider component on

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.