@Override
    protected Object createBody() {
        if (command instanceof MessageRequest) {
            MessageRequest msgRequest = (MessageRequest) command;
            byte[] shortMessage = msgRequest.getShortMessage();
            if (shortMessage == null || shortMessage.length == 0) {
                return null;
            }
            Alphabet alphabet = Alphabet.parseDataCoding(msgRequest.getDataCoding());
            if (SmppUtils.is8Bit(alphabet)) {
                return shortMessage;
            }

            String encoding = ExchangeHelper.getCharsetName(getExchange(), false);
            if (ObjectHelper.isEmpty(encoding) || !Charset.isSupported(encoding)) {
                encoding = configuration.getEncoding();
            }
            try {
                return new String(shortMessage, encoding);
            } catch (UnsupportedEncodingException e) {
                LOG.info("Unsupported encoding \"{}\". Using system default encoding.", encoding);
            }
            return new String(shortMessage);
        }

        return null;
    }
@Test
    public void createBodyShouldNotMangle8bitDataCodingShortMessage() {
        final Set<String> encodings = Charset.availableCharsets().keySet();

        final byte[] dataCodings = {
                (byte) 0x02,
                (byte) 0x04,
                (byte) 0xF6,
                (byte) 0xF4
        };

        byte[] body = {
                (byte) 0xFF, 'A', 'B', (byte) 0x00,
                (byte) 0xFF, (byte) 0x7F, 'C', (byte) 0xFF
        };

        DeliverSm command = new DeliverSm();
        SmppConfiguration config = new SmppConfiguration();

        for (byte dataCoding : dataCodings) {
            command.setDataCoding(dataCoding);
            command.setShortMessage(body);
            for (String encoding : encodings) {
                config.setEncoding(encoding);
                message = new SmppMessage(camelContext, command, config);

                assertArrayEquals(
                        body, (byte[]) message.createBody(),
                        String.format("data coding=0x%02X; encoding=%s",
                                dataCoding,
                                encoding));
            }
        }
    }