JeanC
18th February 2011, 08:46
Hello,
I am writing a little console program that will spit out a bit of html to be used by php's passthru() function:
<?php passthru('/var/www/bin/myprog');?>
Now I need to display the character °, but the output I get with QString in the resulting html is °.
So I'm trying to get rid of the  but no succes till now.
I'm thinking that it's because of the unicode in QString but f I try with char in stead of QString it won't even output anything, ie:
char *s = "°"; // or 167
cout << s;
just prints nothing.
When I launch the program from bash, it displays the ° ok, but if I copy that character from the console to an editor I get an ° again, meaning it's still unicode.
I tried various things, .toUtf8(), etc etc but I can't get the right character to display.
How can I get the ° without the  in my html?
Thanks.
Edit: solved by adding 'AddDefaultCharset UTF-8' to '/etc/apache2/sites-available/default'. Though I am still curious why there is no output at all on that first code snippet.
I am writing a little console program that will spit out a bit of html to be used by php's passthru() function:
<?php passthru('/var/www/bin/myprog');?>
Now I need to display the character °, but the output I get with QString in the resulting html is °.
So I'm trying to get rid of the  but no succes till now.
I'm thinking that it's because of the unicode in QString but f I try with char in stead of QString it won't even output anything, ie:
char *s = "°"; // or 167
cout << s;
just prints nothing.
When I launch the program from bash, it displays the ° ok, but if I copy that character from the console to an editor I get an ° again, meaning it's still unicode.
I tried various things, .toUtf8(), etc etc but I can't get the right character to display.
How can I get the ° without the  in my html?
Thanks.
Edit: solved by adding 'AddDefaultCharset UTF-8' to '/etc/apache2/sites-available/default'. Though I am still curious why there is no output at all on that first code snippet.