[Qt-interest] Problem in QString interpretation of single-quote closing apostrophe (’)

Sarath sarath at softjin.com
Wed Jul 7 15:04:33 CEST 2010


Hi All,

I am facing a problem in using QString to capture the string containing 
apostrophe (’) character.

Please find below a sample program to reproduce the problem.
****************************************************
#include <iostream>
#include <QString>

int main ()
{
     QString str = "single-quote’";
     std::cout << "str is " << str.toAscii().constData() << std::endl;

     return 0;
}
*************************************************
The output I get when I run this program is : str is single-quoteÆ

Please suggest a method to overcome this issue.

Thanks & Regards,
Sarath


Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for  the use  of the  individual or entity  to which they  are  addressed. It
may  contain confidential,  proprietary or legally  privileged  information.
If  you  are  not  the  intended recipient please be advised that you have
received  this  message in error and any use is strictly prohibited. Please
immediately  delete it  and all copies of it from your system, destroy any
hard  copies  of  it and  notify  the  sender  by return mail. You must not,
directly or indirectly, use,  disclose,  distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________





More information about the Qt-interest-old mailing list