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 615405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:13:00+00:00 2026-05-13T18:13:00+00:00

I am currently scraping an rss feed from last.fm and the title attribute looks

  • 0

I am currently scraping an rss feed from last.fm and the title attribute looks like it has a unicode “-” that comes up as \u2013 on firebug. Here is the feed for those that are curious:

http://ws.audioscrobbler.com/2.0/user/rj/recenttracks.rss

When I write something like this

feedentry.title.split('-')

it won’t find the unicode dash. I have also tried this:

@feedsplit = feedentry.title.gsub(/\u2013/,'-').split("-") 

and some variations like using [] ranges. No luck. I took a look at the other answers floating around, and none of them seem to work for me, so this is my last hope.

Thanks for your time!

  • 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-05-13T18:13:01+00:00Added an answer on May 13, 2026 at 6:13 pm

    The \u2013 syntax only works with Ruby 1.9, which is fully Unicode aware. I’m guessing that you are running Ruby 1.8.

    In Ruby 1.8, you can still use the unicode dash as argument to split. These both work:

    feedentry.title.split("–")             # The actual UTF-8 char
    feedentry.title.split("\342\200\223")  # The sequence of bytes
    

    In regular expressions, remember to set the u modifier for unicode compatibility (outside of Rails):

    @feedsplit = feedentry.title.gsub(/–/u,'-').split("-") 
    

    Alternatively, set $KCODE = "U", which implies the u modifier for all regular expressions. Rails does this for you already.

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

Sidebar

Related Questions

I currently have a table that is 17 columns wide and has 30 records.
I have a script that is scraping URLs from various sources, resulting in a
I currently have a script that takes 1,000 rows at a time from a
I'm currently scraping content from a website using PHP and YQL. I need to
We currently use a product from NSoftware that allows us to connect to banks
I am currently scraping some data from the internet and converting into xml documents.
I am currently playing around with different scraping techniques and found out, that it
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
Currently working with converting SQLException error messages into messages that are more useful for
I am scraping a list of RSS feeds by using cURL, and then I

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.