LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-05-2009, 02:54 PM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 779

Rep: Reputation: 67
Question Printing Unicode characters in C


Hi all,
Say I want to write some of the more exotic Unicode characters to a file, what's the proper way to do it? when decimal integers are involved, we use %d for floating point we use %f and for hex we use %p.What's the equivalent marker for Unicode values that C understands?
 
Old 09-05-2009, 04:02 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Are you talking about UTF-16? What about fwprintf?
Kevin Barry
 
Old 09-05-2009, 04:11 PM   #3
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 111Reputation: 111
Long version:
http://joelonsoftware.com/articles/Unicode.html

Short version:
UTF-8 is the best thing since sliced bread.
 
Old 09-05-2009, 04:13 PM   #4
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 779

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by ta0kira View Post
Are you talking about UTF-16? What about fwprintf?
Kevin Barry
No, Unicode UTF-8. I'm sure there must be a way of doing it but... d'oh! I can't think what the syntax might be.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do new unicode characters get implemented j1wu Linux - Software 1 04-18-2009 01:23 AM
unicode/japanese characters in C merc64 Programming 6 03-13-2007 07:00 PM
Yahoo AddressBook Unicode Characters shreks Linux - Software 0 11-26-2006 09:38 PM
Unicode characters in Firefox Ephracis Linux - Software 6 10-14-2005 04:05 PM
printing unicode characters in JAVA Armand Programming 8 03-06-2004 07:51 PM


All times are GMT -5. The time now is 02:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration