GithubHelp home page GithubHelp logo

Parsing Hebrew about mwfeedparser HOT 2 CLOSED

mwaterfall avatar mwaterfall commented on July 29, 2024
Parsing Hebrew

from mwfeedparser.

Comments (2)

aporat avatar aporat commented on July 29, 2024

I had a similar issue. it's not really an issue with Hebrew or MWFeedParser. ynet encode their RSS feeds incorrectly. (They included a windows-1255 header, while the actual content is in UTF-8...)

Try:

  NSData* encodedData;
    // YNET FIX (wrong windows-1255 in header) (http://www.ynet.co.il) 
    if ([[_feed.url substringToIndex:21] isEqual:@"http://www.ynet.co.il"]) {
      NSString *content = [[NSString alloc]  initWithBytes:[response.data bytes]
                                                    length:[response.data length] 
                                                  encoding: NSASCIIStringEncoding];      

      content = [content stringByReplacingOccurrencesOfString:@"Windows-1255" withString:@"UTF-8"];
      encodedData = [content dataUsingEncoding:NSUTF8StringEncoding];
     } else {
      encodedData = response.data;
    }

from mwfeedparser.

bennyDeveloper avatar bennyDeveloper commented on July 29, 2024

10x a lot :)
Benny

2012/2/1 Adar Porat <
[email protected]

I had a similar issue. it's not really an issue with Hebrew. ynet encode
their RSS feeds incorrectly. (They included a windows-1255 header, while
the actual content is in UTF-8)....

Try:

 // YNET FIX (wrong windows-1255 in header) (http://www.ynet.co.il)
 if ([[_feed.url substringToIndex:21] isEqual:@"http://www.ynet.co.il"]) {
   NSString *content = [[NSString alloc]  initWithBytes:[response.data
bytes]
                                                 length:[response.data
length]
                                               encoding:
NSASCIIStringEncoding];

   content = [content stringByReplacingOccurrencesOfString:@"Windows-1255"
withString:@"UTF-8"];
   encodedData = [content dataUsingEncoding:NSUTF8StringEncoding];
 } else {
   encodedData = response.data;
 }


Reply to this email directly or view it on GitHub:
https://github.com/mwaterfall/MWFeedParser/issues/45#issuecomment-3762111

בני דוידוביץ
BDApps
מייסד ומתכנת
052-7790800
[email protected]

from mwfeedparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.