Irbis
Irbis

Reputation: 13569

How to convert a std::string to windows-1255 bytes?

I have a function which receives a hebrew string and send it through a serial port (boost asio) to the device:

void T::sendInfoMsg(std::string hebrewInfo)
{
   std::vector<uint8_t> msg{hebrewInfo.begin(), hebrewInfo.end()};
   serialPortProxy.sendData(msg);
}

A device doesn't display a text message correctly because it uses windows-1255 encoding. How to convert a std::string to windows-1255 bytes ?

Upvotes: 0

Views: 198

Answers (0)

Related Questions