---
src/qsimcommand.cpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index f12b8ac..1af2b76 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -2813,12 +2813,18 @@ void _qtopiaphone_writeTextString( QByteArray& binary, const
QString& str,
void _qtopiaphone_writeTextString( QByteArray& binary, const QString& str,
QSimCommand::ToPduOptions options, int tag )
{
- if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0
) {
- // Special form for zero-length strings.
+ if ( str.isNull() ) {
binary += (char)tag;
binary += (char)0x00;
return;
}
+ if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0
) {
+ // Special form for empty strings.
+ binary += (char)tag;
+ binary += (char)0x01;
+ binary += (char)options;
+ return;
+ }
int schemeMask = ((tag & 0xFF00) >> 8); // For USSD string output.
if ( ( options & QSimCommand::UCS2Strings ) == 0 ) {
QTextCodec *gsm = QAtUtils::codec( "gsm-noloss" );
--
1.7.0.4