Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-20-2008, 12:54 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 96
Default reading file with Windows-1255 encoding

I have an app that needs to read an html file with charset=Windows-1255. From what I can tell, that is an encoding that is not supported in NSStringEncodings.

Does anybody know how I can do this? The html file will open in a UIWebView just fine, but I need to be able to open, search, and alter the text before it is displayed.
shan is offline   Reply With Quote
Old 12-20-2008, 01:05 AM   #2 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,122
Default

Most likely it is supported. If you look at the very end of the docs for NSStringEncoding you will see a link to docs about CFStringEncoding. This is a much more complete list of encodings. You can use that to create an NSStringEncoding for Windows-1255 most likely.
RickMaddy is offline   Reply With Quote
Old 12-20-2008, 02:12 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 96
Default

Thanks, I was just looking in the String Encodings section of NSString on the API docs. I missed the part where it said it was not a complete list. I have it working:

In case anybody else comes across this thread searching for the same thing:

NSString *myString = [NSString stringWithContentsOfFile:filePath encoding:CFStringConvertEncodingToNSStringEncoding (kCFStringEncodingWindowsHebrew) error:&err];
shan is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 250
24 members and 226 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Dominus, dre, glenn_sayers, HemiMG, JasonR, karlam963, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:27 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0