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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:24:22+00:00 2026-05-13T19:24:22+00:00

I have to open file with cyrillic symbols. I’ve encoded file into utf8. Here

  • 0

I have to open file with cyrillic symbols. I’ve encoded file into utf8. Here is example:

en: Couldn’t your family afford a
costume for you
  ru: Не ваша семья
позволить себе костюм для вас

How do I open file:

ifstream readFile(fileData.c_str());
while (!readFile.eof())
{
  std::getline(readFile, buffer);
  ...
}

The first trouble, there is some symbol before text ‘en’ (I saw this in debugger):

“en: least”

And another trouble is cyrillic symbols:

” ru: наименьший”

What’s wrong?

  • 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-13T19:24:23+00:00Added an answer on May 13, 2026 at 7:24 pm

    there is some symbol before text ‘en’

    That’s a faux-BOM, the result of encoding a U+FEFF BYTE ORDER MARK character into UTF-8.

    Since UTF-8 is an encoding that does not have a byte order, the faux-BOM shouldn’t ever be used, but unfortunately quite a bit of existing software (especially in the MS world) does nonetheless. Load the messages file into a text editor and save it back out again as UTF-8, using a “UTF-8 without BOM” encoding if one is especially listed.

    ru: наименьший

    That’s what you get when you’ve got a UTF-8 byte string (representing наименьший) and you print it as if it were a Code Page 1252 (Windows Western European) byte string. It’s not an input problem; you have read in the string OK and have a UTF-8 byte string. But then, in code you haven’t quoted, it gets output as cp1252.

    If you’re just printing it to the console, this is to be expected, as the console always uses the system default code page (1252 on a Western Windows install), and not UTF-8. If you need to send Unicode to the console you’ll have to convert the bytes to native-Unicode wchar​s and write them from there. I don’t know what the final destination for your strings is though… if you’re just going to write them to another file or something you could just keep them as bytes and not care about what encoding they’re in.

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

Sidebar

Related Questions

I have tried to open a PDF file from the local disk. For example
I have a open file dialog with three filters: QString fileName = QFileDialog::getOpenFileName( this,
In php I have open a .php file and want to evaluate certain lines.
I have the following code: using (BinaryReader br = new BinaryReader( File.Open(FILE_PATH, FileMode.Open, FileAccess.ReadWrite)))
I have a program which needs to hold approximately 3000 open file descriptors in
I have: <?php $file=fopen(date(Y-m-d)..txt,r+) or exit(Unable to open file!); if ($_POST[lastname] <> ) {
I have a FAT12 image file and I have to open it and read
Suppose I have a source file open and I launch a shell. I can
I have to browse for and open a file in AIR. I can access
I have CSV file and Macro in VBA. I want to open CSV file

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.