Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Carrier: Vodafone CZ

MessageBuilder and carriage returns in text

void MessageComposer::composeMessage()
{
    const MessageContact recipient = MessageContact(-1, MessageContact::To, QString(), m_recipient);
    const QByteArray bodyData = m_body.toUtf8();

    // Create a message builder to create/modify the message
    MessageBuilder *builder = (m_mode == CreateMode ? MessageBuilder::create(m_accountId)
                                                    : MessageBuilder::create(m_accountId, m_messageService->message(m_accountId, m_messageId)));

    builder->subject(m_subject);
    builder->removeAllRecipients();
    builder->addRecipient(recipient);
    builder->body(MessageBody::PlainText, bodyData);

    // Send the new message via current account
    m_messageService->send(m_accountId, *builder);
}

 

This code works fine, but message received does not contains carriage returns. For example:

 

This is a message with
carriage returns

 It received as 

This is a message withcarriage returns

 This is a bug or i need to know something else?

 

Please use plain text.