Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7838167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:00:27+00:00 2026-06-02T15:00:27+00:00

I am trying to use a custom logger to give clean console output for

  • 0

I am trying to use a custom logger to give clean console output for a text-based game. Below is the code of the method in question:

void MyLog(NSString *format, ...)
{
    va_list args;
    va_start(args, format);
    NSString *formattedString = [[NSString alloc] initWithFormat:format arguments: args];
    va_end(args);
    [[NSFileHandle fileHandleWithStandardOutput] writeData:[formattedString dataUsingEncoding: NSNEXTSTEPStringEncoding]];
    [formattedString release];
}

and here is this example’s use of it:

NSLog(@"Unicode text: \u2665");
NSLog(@"ASCII Text");
MyLog(@"Unicode text: \u2665");
MyLog(@"ASCII text");

and the output:

2012-04-26 00:08:53.614 TextCraft[11319:a0f] Unicode text: ♥
2012-04-26 00:08:53.617 TextCraft[11319:a0f] ASCII Text
ASCII text

As you can see, the MyLog function works fine for low-page characters, but when it tries to print high-page characters, it simply skips the whole line. Does anyone know why this is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:00:29+00:00Added an answer on June 2, 2026 at 3:00 pm

    You’re using NSNEXTSTEPStringEncoding in your call to -dataUsingEncoding:, which is just ASCII plus some additions. If you want to support Unicode, you should use an appropriate encoding like NSUTF8StringEncoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a custom font with the text in my Widget. Since
I'm trying to use custom attributes to implement authorization permissions to execute a method.
I am trying to use custom font in android. I have written java code
I'm trying to use a custom object's method to emit to a socket connection.
I'm trying to use a custom validator with jQuery Validation plugin. However, I'm unsure
I'm trying to use a custom UITableViewCell, and I've placed it in the same
I am trying to simply use a custom view helper that is located in
I'm trying to use pyqt to show a custom QDialog window when a button
I'm trying to use JRuby in a custom application, and I don't seem to
I'm trying to use an instant of a custom class as a template parameter.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.