C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unicode et fichier source

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
Martinez Jerome
Guest





PostPosted: Tue Jul 27, 2004 9:05 am    Post subject: Unicode et fichier source Reply with quote



Une question idiote, mais frustrante.
Comment ecrire dans un fichier source ASCII de l'Unicode?
genre std::wstring S=L"xxx";
ou xxx est un charactere que je n'ai pas sur mon clavier, mais dont je
connais le n° hexadecimal sur 2 octets?

Back to top
Eric P.
Guest





PostPosted: Tue Jul 27, 2004 10:18 am    Post subject: Re: Unicode et fichier source Reply with quote



Martinez Jerome wrote:

Quote:
Une question idiote, mais frustrante.
Comment ecrire dans un fichier source ASCII de l'Unicode?
genre std::wstring S=L"xxx";
ou xxx est un charactere que je n'ai pas sur mon clavier, mais dont je
connais le n° hexadecimal sur 2 octets?

Tu peux présenter la chaîne constante sous forme de tableau de caractères:
S = {0x123F, 0x4CD0, L''};

Back to top
Serge Paccalin
Guest





PostPosted: Tue Jul 27, 2004 12:15 pm    Post subject: Re: Unicode et fichier source Reply with quote



Le mardi 27 juillet 2004 à 11:05, Martinez Jerome a écrit dans
fr.comp.lang.c++ :

Quote:
Une question idiote, mais frustrante.
Comment ecrire dans un fichier source ASCII de l'Unicode?
genre std::wstring S=L"xxx";
ou xxx est un charactere que je n'ai pas sur mon clavier, mais dont je
connais le n° hexadecimal sur 2 octets?

// 1 - La séquence hexa apparaît dans le code objet :
std::wstring S = L"Relevxe9 de compte";

// 2 - Le caractère Unicode apparaît dans le code objet :
std::wstring S = L"Relevu00e9 de compte"; // 4 chiffres exactement
std::wstring S = L"RelevU000000e9 de compte"; // 8 chiffres exactement

--
___________ 2004-07-27 14:00:27
_/ _ _`_`_`_) Serge PACCALIN -- sp ad mailclub.net
_L_) Il faut donc que les hommes commencent
-'(__) par n'être pas fanatiques pour mériter
_/___(_) la tolérance. -- Voltaire, 1763

Back to top
Serge Paccalin
Guest





PostPosted: Thu Jul 29, 2004 10:40 am    Post subject: Re: Unicode et fichier source Reply with quote

Le mardi 27 juillet 2004 à 14:15, Serge Paccalin a écrit dans
fr.comp.lang.c++ :

Quote:
Le mardi 27 juillet 2004 à 11:05, Martinez Jerome a écrit dans
fr.comp.lang.c++ :

Une question idiote, mais frustrante.
Comment ecrire dans un fichier source ASCII de l'Unicode?
genre std::wstring S=L"xxx";
ou xxx est un charactere que je n'ai pas sur mon clavier, mais dont je
connais le n° hexadecimal sur 2 octets?

// 1 - La séquence hexa apparaît dans le code objet :
std::wstring S = L"Relevxe9 de compte";

// 2 - Le caractère Unicode apparaît dans le code objet :
std::wstring S = L"Relevu00e9 de compte"; // 4 chiffres exactement
std::wstring S = L"RelevU000000e9 de compte"; // 8 chiffres exactement

Les séquences sont correctes, mais ne faites pas attention aux
commentaires.

--
___________ 2004-07-29 12:40:26
_/ _ _`_`_`_) Serge PACCALIN -- sp ad mailclub.net
_L_) Il faut donc que les hommes commencent
-'(__) par n'être pas fanatiques pour mériter
_/___(_) la tolérance. -- Voltaire, 1763

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.