Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encoding in sprintf

Tags:

c

printf

encoding

In the following code:

char test[50];
sprintf(test, "áéíóú");

is there a way to make sprintf interpret input characters as Windows-1252 instead of Unicode? I mean, to make test contain 0xE1E9EDF3FA... instead of 0xC3A1C3A9C3ADC3B3C3BA...

like image 595
funkadelic Avatar asked Oct 23 '25 06:10

funkadelic


1 Answers

You have to edit this from inside your text editing program. This is a matter of the actual file that contains your source code.

To do that in most editors and IDEs there is a menu called ENCODING

EDIT: More specifically for Geany, which appears to be the software you are running go to:

Document >> Set Encoding >> West European >> Western (1252)

like image 141
Lefteris Avatar answered Oct 24 '25 20:10

Lefteris