French special characters and of 0.9.8


#1

Hello, using
myFont->loadFont("fonts/calibrib.ttf", 40, true, true); with VS2015 / W10
doesn’t give access to special characters with accent ( é à ï ê … )
it seems that special characters are not loaded.

is there any other way to print them to screen ?
thank you


#2

that should work as long as your source is saved as utf-8 which i think visual studio doesn’t do by default.


#3

Always a good time to share this: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)


#4

Thanks a lot, helas there is MANY things around UTF-8: source file encoding, option in VS, command lines options (very funny: # are no more alloweded), locale parameters. I m making many tests, but it still doesnt displays my special characters.

for the moment, i m just trying a test with
myFont->drawString(ofToString("test UTF8: é à è"), 200,200);
but i have only on screen test UTF8 printed

this page was sounding the most significant , without result:

i m sure i m not alone facing this puzzling problem, is there any step by step to solve this ?


#5

you can also just open the file in some other editor and save it as utf8


#6

Hum… i have downloaded notepad C++ and resaved the file (already shown as UTF-8).
very very strange…

i have now from VS2015 this report, saying that ofApp.h contains its self include…

Gravité Code Description Projet Fichier Ligne État de la suppression
Erreur (active) le fichier #include “C:\CODE\OF_V0.9.8_VS_RELEASE\APPS\MYAPPS\MKII\SRC\ofApp.h” s’inclut lui-même mkII c:\Code\of_v0.9.8_vs_release\apps\myApps\mkII\src\ofApp.h 1
Erreur C1014 fichiers Include trop nombreux : profondeur = 1024 (compilation du fichier source src\ofApp.cpp) mkII c:\code\of_v0.9.8_vs_release\apps\myapps\mkii\src\ofApp.h 1
Erreur C1014 fichiers Include trop nombreux : profondeur = 1024 (compilation du fichier source src\main.cpp) mkII c:\code\of_v0.9.8_vs_release\apps\myapps\mkii\src\ofApp.h 1


#7

ok, i have recleaned my project.

and set it back ok. so it can compil ect… but without accent.

Now, using notepad++ i saved my ofApp.cpp and .h using UTF-8, but now VC is no more compiling, saying too much include in ofApp.h

Gravité	Code	Description	Projet	Fichier	Ligne	État de la suppression
Erreur (active)		le fichier #include "C:\CODE\OF_V0.9.8_VS_RELEASE\APPS\MYAPPS\MKII\SRC\ofApp.h" s'inclut lui-même	mkII	c:\Code\of_v0.9.8_vs_release\apps\myApps\mkII\src\ofApp.h	2

#8

Hum, still in a deep trouple, nothing is no more actually compiling…

Any idea from any VS2015 user ( i m an ex- code blocks, so a bit lost)


#9

not sure what might be going on, looking a bit there seems to be no easy way to make visual studio save as utf8. a possible solution would be to left the encoding of the source as it is and then load the strings from a file saved as utf8


#10

hello arturo, i m comming back to my code after a long break, and i have a real problem with visual studio its no more compiling…
a lot of errors mainly this one:

in ofApp.cpp

#include "ofApp.h" vector <wcFader> myFaders;

the compilator give me:
1>------ Début de la génération : Projet : mkII, Configuration : Debug Win32 ------
1> ofApp.cpp
1>src\ofApp.cpp(1): error C3873: ‘0x2028’ : ce caractère n’est pas autorisé comme premier caractère d’identifiant
1>src\ofApp.cpp(1): error C2006: ‘#include’ : nom de fichier attendu, ‘user-defined string literal’ rencontré
1>src\ofApp.cpp(1): fatal error C1083: Impossible d’ouvrir le fichier include : ‘’ : No such file or directory
========== Génération : 0 a réussi, 1 a échoué, 1 mis à jour, 0 a été ignoré ==========

do you have any idea ?
sincerely yours, have a beautiful day :slight_smile:


#11

no idea what might be going on, perhaps try saving the file with a different encoding in a text editor


#12

thank you arthuro, i will try.


#13

Hello Arturo, thank you i finally founded the solution, i dont know why and how but my ofApp.cpp wasnt recorded in good format.

if anybody write you about this topic:
with VS: record as the ofApp.cpp > select in recording the option record with encoding > select UTF-8 and Windows type, not actual type (default).

yours:) happy to refind all my code working :slight_smile:


#14

that’s good to know, thanks for writing back with your findings