visual studio - C++ Processing Cyrillic strings in English Windows -


i wrote application connects active directory located on windows server 2012. @ first application retrieves organisation units names ad. gets users every organization unit, process them , send information webapp.

organization units , users ad can have names both in english , russian.

so when i'm running app in windows russian system language goind good.

but when i'm trying run on windows server(or windows 7 english system language) i'm getting sequences of "?" instead of russian strings both in:

  1. logfile
  2. console output
  3. active directory search string, contains name of organization unit

inside application tried use std::string , std::wstring hold extracted active directory data , got same result - "?" instead of russian words.

using msvs 2013, windows 8.1 on developer stand. , libldap(setting version 3) connect active directory.

what need make application correctly process russian strings?

just found solution.
used functions multibytetowidechar , widechartomultibyte convert between std::string , std::wstring cp_acp first argument. when changed cp_utf8 went fine.

by way, changed encoding of project's files utf-8 without bom.

@iinspectable, thank helping


Comments