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

  • Home
  • SEARCH
  • 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 7582821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:31:49+00:00 2026-05-30T18:31:49+00:00

I am trying to read a UTF-8 text file in Visual C++ 2010 using

  • 0

I am trying to read a UTF-8 text file in Visual C++ 2010 using only the standard library and not Boost or Windows APIs. I define the locale as:

std::locale utf8_locale(std::locale(), new std::codecvt_utf8<wchar_t>);

but this results in the following compiler error:

error C2661: 'std::locale::facet::operator new' : no overloaded function takes 3 arguments
error C2664: 'std::locale::locale(const char *,std::locale::category)' : cannot convert parameter 1 from 'std::locale' to 'const char *'
  • 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-30T18:31:50+00:00Added an answer on May 30, 2026 at 6:31 pm

    The error is occures in debug mode when the code is used in the file that micrsoft Visual c++ provided below macro is placed.

    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif
    

    to get rid of this error the #define new DEBUG_NEW should be commented out or the code should be implemented in another file which does not have the above macro.
    This bug for Visual c++ 2010 is mentioned here http://connect.microsoft.com/VisualStudio/feedback/details/683483/mfc-c-fails-to-compile-use-of-codecvt-utf8-in-debug-configuration

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

Sidebar

Related Questions

I'm trying to read UTF-8 from a text file and do some tokenization, but
I'm trying to read a simple unicode (UTF-16) text file with just some numbers
I'm trying to read xml file from vbs script. Xml is encoded in utf-8
I'm trying to read and print a file that may or may not contain
I'm trying to use urllib and urllib2 to read from a text file that
I'm trying to write an array (list?) to a text file using Python 3.
I am trying to read from an ncx file (i.e. xml file) using XElement:
I`m trying to read my build version number from a text file, and then
Trying to read an RSS and select information using Linq but can't seem to
Trying to read headers for a csv file with: reader = csv.DictReader(open(PATH_FILE),skipinitialspace=True) headers =

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.