jakamph
13th February 2006, 21:03
I'm trying to print the copyright circle C ( © ) into an output file (company requirement). I declare the first part of the copyright notice in a #define
#define COPYRIGHT_PREFIX "\xA9 Copyright"
#define COPYRIGHT_SUFFIX "Company Name. All Rights Reseved."
I then put it into a QString along with the year and then output it to a QDomDoc in the form of a QDomComment.
QDomComment copyrightComment;
QDate copyrightDate = QDate::currentDate( );
QString copyrightString;
copyrightString.sprintf( "%s%d%s", COPYRIGHT_PREFIX, copyrightDate.year( ), COPYRIGHT_SUFFIX );
/* I created the document earlier */
copyrightComment = outDoc.createComment( copyrightString );
When the comment in the document gets output to a file, I don't get the ©, but just get two question marks printed out ( ?? ). Is there something that I'm forgetting to do? Do I have to make use of one of the QString functions (I've tried .ascii( ) )?
Any help is appreciated.
#define COPYRIGHT_PREFIX "\xA9 Copyright"
#define COPYRIGHT_SUFFIX "Company Name. All Rights Reseved."
I then put it into a QString along with the year and then output it to a QDomDoc in the form of a QDomComment.
QDomComment copyrightComment;
QDate copyrightDate = QDate::currentDate( );
QString copyrightString;
copyrightString.sprintf( "%s%d%s", COPYRIGHT_PREFIX, copyrightDate.year( ), COPYRIGHT_SUFFIX );
/* I created the document earlier */
copyrightComment = outDoc.createComment( copyrightString );
When the comment in the document gets output to a file, I don't get the ©, but just get two question marks printed out ( ?? ). Is there something that I'm forgetting to do? Do I have to make use of one of the QString functions (I've tried .ascii( ) )?
Any help is appreciated.