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

  • Home
  • SEARCH
  • 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 7945029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:43:57+00:00 2026-06-04T00:43:57+00:00

We are developing a simple usenet reader for iOS5 implementing the NNTP protocol. Unfortunately

  • 0

We are developing a simple usenet reader for iOS5 implementing the NNTP protocol.

Unfortunately we have some problem with the encoding: A header may look like:

Subject: Re: [GA] =?ISO-8859-15?Q?Pr=FCfungsmodus?= 
Date: 22 Apr 2012 22:50:38 +0200

Is there some simple way in Objective-C to convert a NSString containing =?ISO-8859-15?Q?Pr=FCfungsmodus?= to “Prüfungsmodus“?

Thanks

EDIT:

Hm. I’m not sure if I got this right:
You meant something like:

NSRange range = [input rangeOfString:@"=?"];
NSRange range2 = [input rangeOfString:@"?="];

NSString *string_to_decode = [input substringWithRange:NSMakeRange(range.location, range2.location-(range.location-2))];


NSData *data = [string_to_decode dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion:YES];

NSString *converted = [[NSString alloc] initWithData:data encoding:(NSISOLatin1StringEncoding)];

Because that’s not working..

EDIT2
Trying to convert the raw bytes:

uint8_t buffer[1024];
iStream read:buffer maxLength:sizeof(buffer)
NSString *output = [[NSString alloc] initWithBytes:buffer length:len encoding:NSISOLatin1StringEncoding];

No matter which encoding I choose here the Subject: Field will always look the same (except for japanese etc encoding…)

  • 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-04T00:43:59+00:00Added an answer on June 4, 2026 at 12:43 am

    If you are doing this yourself from first principles then in outline:

    • Read the bytes from the network
    • Determine the ranges of each run in a particular encoding – in your example you’re looking for =?…?= sections [this looks like MIME word encoding] – for each range you need byte pointer, length, encoding [which may be both a character set and a separate encoding style, here it looks like ISO-8859-15 with Q-encoding]
    • create an NSString for each using - (id)initWithBytes:(const void *)bytes length:(NSUInteger)length encoding:(NSStringEncoding)encoding

    • concatenate

    • you also need to deal with other escape sequences in the input, e.g. when the input contains a literal =?

    For details on MIME look at Wikipedia.

    [Edit: added notes on MIME.]

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

Sidebar

Related Questions

i'm developing simple cms application. i want to integrate number of hits for some
I have 6 months experience with Android, developing simple UI-based applications. Now I want
I'm developing simple MVC app in Cocoa/Objective-C. I have a strange issue (or misunderstanding)
Im developing a simple application that have a line like this: string[] values =
im developing a simple Mxml application using flex 3. I have used simple text
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I'm developing a simple epub reader on iPhone but been wondering how to go
I am developing a simple app for blacberry with eclipse. I have just set
I'm developing a simple protocol that is used to read/write integer values from/to a
I am a newbie to the programming world. I have experiences of developing simple

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.