Forums | MacLife
You are not logged in.
#1 2007-01-12 7:17 pm
- dcalfine
- B&

- From: The City
- Registered: 2003-12-01
- Posts: 2413
Need Help Quick Please! - Unicode characters in Xcode
Hi everyone,
Sorry to have a rude title for this thread, but I need to solve this problem in like the next 3 hours!
I'm coding a poker game in C++ in Xcode. I want to use those cool Unicode card suit symbols. When I created a simple program that would just cout the symbols, they worked fine, but now they cout "\243" or something like that. Why is that?
I'm currently using Xcode 2.0. At some point, I used a PC and compiled in Dev C++. Would this have thrown off the characters? How can I change them back? My file coding is UTF-8 with Macintosh line endings. I tried converting to UTF-16, but it made EVERY SINGLE CHARACTER a warning and gave me a handful of errors that shouldn't have existed.
Thanks in advance!
David
Offline
#2 2007-01-13 10:43 am
Re: Need Help Quick Please! - Unicode characters in Xcode
your terminal must support the UTF-8 character set, for the Mac OS X terminal its under Terminal->Window Settings->Display-Character set encoding, then to see the symbols you want it needs to be using a font with that character in it (very few fonts are going to have what your looking for)
the \243 looks like an escape sequence, its probably invalid in your terminal for the specified character set, or maybe the character doesn't exist in your font
if your trying to make some command line app then you really should only rely on the first 127 characters in ASCII working
also in your code, for portability if you ever need to enter a character in your code thats outside the standard ASCII characters then use its escape sequence (put it in hex for example)
Offline
