Foreign/International Characters

Foreign/International Characters

Post by Goatboy on Sat Feb 28, 2009 9:49 pm
([msg=18937]see Foreign/International Characters[/msg])

Alright, so I am helping my friend learn C++ and Spanish at the same time, so I wrote a simple program (so he can review the source code) that quizzes him on his Spanish vocab. It reads a word at random from a list and he writes the translation. The problem, however, is that I when I try to read a foreign character, such as á or é, it either shows up as a question mark or or doesn't show up at all.

I have googled a lot of different strings, and read about UNICODE, UTF-8 and Latin 1, but nothing ever explains what to include in the source code.

Is there some header, namespace, or #define I need to include? Any help is appreciated.

While I wait for a response, I'm gonna be googling more.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2788
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by mischief on Sat Feb 28, 2009 10:24 pm
([msg=18940]see Re: Foreign/International Characters[/msg])

The whole secret of existence is to have no fear. Never fear what will become of you, depend on no one. Only the moment you reject all help are you freed.
--Buddha
User avatar
mischief
Poster
Poster
 
Posts: 355
Joined: Wed Jan 07, 2009 4:16 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by Goatboy on Sat Feb 28, 2009 10:40 pm
([msg=18941]see Re: Foreign/International Characters[/msg])



Second link was VERY helpful. Works like a charm. Thank you tons, this has been bothering me for a while.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2788
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by centip3de on Mon Aug 30, 2010 2:26 pm
([msg=44535]see Re: Foreign/International Characters[/msg])

Goatboy wrote:Alright, so I am helping my friend learn C++ and Spanish at the same time, so I wrote a simple program (so he can review the source code) that quizzes him on his Spanish vocab. It reads a word at random from a list and he writes the translation. The problem, however, is that I when I try to read a foreign character, such as á or é, it either shows up as a question mark or or doesn't show up at all.

I have googled a lot of different strings, and read about UNICODE, UTF-8 and Latin 1, but nothing ever explains what to include in the source code.

Is there some header, namespace, or #define I need to include? Any help is appreciated.

While I wait for a response, I'm gonna be googling more.



Wha?! Goatboy needs help??! ITS THE APOCALYPSE!!!!!
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1412
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by sanddbox on Mon Aug 30, 2010 2:28 pm
([msg=44536]see Re: Foreign/International Characters[/msg])

centip3de wrote:
Goatboy wrote:Alright, so I am helping my friend learn C++ and Spanish at the same time, so I wrote a simple program (so he can review the source code) that quizzes him on his Spanish vocab. It reads a word at random from a list and he writes the translation. The problem, however, is that I when I try to read a foreign character, such as á or é, it either shows up as a question mark or or doesn't show up at all.

I have googled a lot of different strings, and read about UNICODE, UTF-8 and Latin 1, but nothing ever explains what to include in the source code.

Is there some header, namespace, or #define I need to include? Any help is appreciated.

While I wait for a response, I'm gonna be googling more.



Wha?! Goatboy needs help??! ITS THE APOCALYPSE!!!!!


This was awhile ago, before he was mod IIRC.
Image

HTS User Composition:
95% Male
4.98% Female
.01% Monica
.01% Goat
User avatar
sanddbox
Expert
Expert
 
Posts: 2337
Joined: Sat Jul 04, 2009 5:20 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by centip3de on Mon Aug 30, 2010 2:31 pm
([msg=44537]see Re: Foreign/International Characters[/msg])

This was awhile ago, before he was mod IIRC.



Oooohhh ^.^ Well anyway, while I have you, would you mind telling me how you got the different ranks? i.e. "Poster, Addict" etc.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1412
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by Goatboy on Mon Aug 30, 2010 2:46 pm
([msg=44538]see Re: Foreign/International Characters[/msg])

OLD THREAD IS OOOOOOOOOOOOOOOLD.

Yes, this was before I was a mod. They were my second and third posts, respectively. Just goes to show that anyone can learn here, and everyone has something to learn.

Different ranks are based upon your post count. I think the 1,000-post mark is Addict.
Assume that everything I say is or could be a lie.
1UHQ15HqBRZFykqx7mKHpYroxanLjJcUk
User avatar
Goatboy
Expert
Expert
 
Posts: 2788
Joined: Mon Jul 07, 2008 9:35 pm
Blog: View Blog (0)


Re: Foreign/International Characters

Post by centip3de on Mon Aug 30, 2010 3:07 pm
([msg=44543]see Re: Foreign/International Characters[/msg])

Goatboy wrote:I think the 1,000-post mark is Addict.

:o and :shock: respectively.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook
User avatar
centip3de
Moderator
Moderator
 
Posts: 1412
Joined: Fri Aug 20, 2010 5:46 pm
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests