Skip navigation.
 
mlstringWithContentsOfFile not loading image files correctly anymore
FROM : OSX Developer
DATE : Wed Jan 09 08:34:02 2002

If you use stringWithContentsOfFile:
[webHeaderedReadyForImageDataString appendString:[NSString stringWithContentsOfFile:@”/tmp/SomeImageFile.jpeg”]];

To append an image files data to a string that has been pre loaded with the appropriate headers for displaying via a web script.
The method has been changed (since the wisdom of OpenStep) to interpret the data as Unicode characters.
This damages the data and is not a true representation of what the bytes in the file are anymore or at least not directly displayable anymore.

What do I do in light of this new wisdom now?

Rebuild and redesign the string class method stringWithContentsOfFile: should this not be called stringWithContentsOfFile: andInterpretAsUnicodedIfPossible:(BOOL)botherWithTheNewWay !?! [NO]

  From  Mystified and our new leaders thought processes.

I got a thousand lines of code to find and change now otherwise, a virtually impossible and quite disabling situation.



------------------------------------------------------------
WWW.COM - Where the Web Begins! http://www.www.com

Related mailsAuthorDate
mlstringWithContentsOfFile not loading image files correctly anymore OSX Developer Jan 9, 08:34
mlRe: stringWithContentsOfFile not loading image files correctly anymore Ali Ozer Jan 10, 12:34