How can i get the correct text from a string like it show in the original source with the quotation marks in the right place ?

The text is in hebrew so the problem is that sometimes the quotation marks not in the right place.
For example i have this text: תווית
על בגד: ''תן לאישה לכבס. זה תפקידה''
This is the source original text you can see the quotations marks and they are not in the right place and all i did is copy paste.
And this is a screenshot of how this text looks like in the website in the original:
You can see now where the quotations marks should be.
Now this is how i'm using the text in my program:
First of all i'm using a webclient to download the page from the website and i'm also encoding it to windows-1255 since it's in hebrew.
using (var webClient = new WebClient())
webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
byte[] myDataBuffer = webClient.DownloadData("http://rotter.net/scoopscache.html");
page = Encoding.GetEncoding("windows-1255").GetString(myDataBuffer);
Then i'm extracting the places i need by reading the html file lines and parsing the right text and it's link.
string loc;
List<string> metas = new List<string>();
List<string> metas1 = new List<string>();
List<string> lockedLinks1 = new List<string>();
string text = "";
string mys = "";
public List<string> LockedThreads(string filename)
lockedThreads = new List<string>();
lockedLinks = new List<string>();
Regex textRegex = new Regex("ToolTip.*?(?=','<)");
string[] fall = File.ReadAllLines(filename);
for (int i = 0; i < fall.Length; i++)
if (fall[i].Contains("http://rotter.net") && fall[i].Contains("locked")||
fall[i].Contains("locked_icon_general") ||
fall[i].Contains("locked_icon_anchor") ||
fall[i].Contains("icon_anchor") ||
fall[i].Contains("locked_icon_fire") ||
fall[i].Contains("locked_icon_sport") ||
fall[i].Contains("locked_icon_camera") ||
fall[i].Contains("locked_icon_movie"))
Regex linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match m in linkParser.Matches(fall[i + 2]))
if (m.Value.Contains("><b"))
loc = m.Value.Replace("\"><b", string.Empty);
lockedLinks.Add(loc);
string txt = fall[i - 1];
string text = textRegex.Match(txt).Value.Replace("ToolTip','", String.Empty);
if (text.Contains("&rsquo;"))
text = text.Replace("&rsquo;", string.Empty);
lockedThreads.Add(text);
Already here on the List lockedThreads you can see the quotation marks not in the right place as in the original:
After i'm parsing the text and links and adding them to the Lists in another class i'm doing a comparison using this Lists:
foreach (List<string> l_branch in ListsExtractions.responsers)
TreeNode l_node = treeView1.Nodes.Add(l_branch[l_branch.Count - 1]);
if (ListsExtractions.lockedThreads.Contains(l_node.Text))
l_node.ImageIndex = 0;
l_node.SelectedImageIndex = 0;
for (int l_count = 0; l_count < l_branch.Count - 1; l_count++)
TreeNode l_subnode = l_node.Nodes.Add(l_branch[l_count]);
if (ListsExtractions.lockedThreads.Contains(l_subnode.Text))
l_subnode.ImageIndex = 0;
l_subnode.SelectedImageIndex = 0;
The problem is in the line:
if (ListsExtractions.lockedThreads.Contains(l_node.Text))
When it's getting to the line with the quotation marks it's never equal.
Now there are more quotation marks.
In general the problem when comparing both text if it's having quotation marks it's not the same.
So i have two options:
1. To fix it somehow so the quotation marks will be the same in both variables when comparing and also the same like in the original as they show in the html page.
2. To remove the quotation marks from both variables.
What should i do ? And how ? I was prefer to use the original quotation marks like in the original since they have a meaning in the place they should be. The question is how can i do it ?
This is example of the block from the html file where the text with the quotation marks is:
<TD ALIGN="RIGHT" VALIGN="TOP">&nbsp;<font size=-1 color=#ff9933><b>9418</b></font>&nbsp;</TD></TR><TR BGCOLOR="#eeeeee">
<TD ALIGN="RIGHT" VALIGN="TOP">
<body onmousemove="overhere()">
<a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();" onmouseout="deActivate()" href="javascript:void(0)">
<img src="http://rotter.net/forum/Images/new_locked_icon_general.gif" border="0"></a></TD><TD ALIGN="right" VALIGN="TOP" WIDTH="55%">
<FONT CLASS='text15bn'><FONT FACE="Arial">
<a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=read_count&om=189696&forum=scoops1"><b>
<font color="898A8E">תווית על בגד: ''תן לאישה לכבס. זה תפקידה''</b>
</a></font></TD>

Ok, it is unclear on what is happening here.
Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
This is what I see the of your example text which is trying to be parse out:
<a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
Hence a garbage in, garbage out situation.
William Wegerson (www.OmegaCoder.Com)

Similar Messages

  • How can I get High Lighted text from JTextPane?

    I can get Selected text when right click.
    But, I have to get high lighted text without Right click.
    How can I do this?
    Is it possible any way?

    Hi,
    you could try it with Document doc = editor.getDocument();
    int start = editor.getSelectionStart();
    String selectedText = doc.getText(start, editor.getSelectionEnd() - start);(editor above being your JTextPane).
    Ulrich

  • How can I get a tab to open in an oversize jpg image in its original size with scroll bars when I click on a link?

    I have a small program for storing my genealogy names and jpg images of the census pages where each name is found. The images have a thumbnail link that opens in a new tab to view the actual oversized census page. In the new tab the census page is small and not readable. How do I get the jpg image to appear in its original size with schroll bars so I can read the census in the firefox browser without using the zoom feature. It takes several clicks on the zoom to get the image to a readable size and that is time consuming, especially when I have several images opened.

    That works, thank you!
    Could I suggest that this feature (the ability to turn off or turn on the auto-resize of images) be part of the Options tab on Firefox? I think it's a setting that some users might want to change fairly often--even toggle back and forth on. It's a little annoying to have to go into about:config every time to do this.

  • How can I get CDP neighbor information from access point reports in Cisco Prime 2.0

    How can I get CDP neighbor information from access point reports in Cisco Prime 2.0?  I have looked through all the reports and I cannot find a report that gives me the CDP neighbor information of an access point.  I thought that information was in there, however I cannot seem to find it.
    Thanks in advance!

    Hi
    You can get this from an inventory report in PI (Select Report Type AP). Here is an example of PI 2.1 works for me. Once you export this into excel you can sort based on controllers & filter the single controller connected AP you want.
    Regards
    Rasika
    **** Pls rate all useful responses ****

  • How can I get my instructional text to display when I open the pdf?

    I have some fields which I have set up which have help/instructions for completing the information required.  This is a questionnaire.  When I save it as a pdf, the instsructional text does not display.  I would really appreciate if someone can tell me how to fix this.

    Thanks for taking the time to respond to my query.  The text does not display when I hover my mouse over it.
    cheers    Deborah Frow
          From: Ajlan huda <[email protected]>
    To: Deborah Frow <[email protected]>
    Sent: Monday, 12 January 2015, 5:24
    Subject: Reply marked as helpful on How can I get my instructional text to display when I open the pdf?
    |
    How can I get my instructional text to display when I open the pdf?
    Ajlan huda marked SumitV's reply on How can I get my instructional text to display when I open the pdf? as helpful. View the full replyMarked as helpful:Hi Pacific Immigration, In Adobe Acrobat/ Adobe Reader there is no “?” shown for help, but if you mouse over the field for 1-2 seconds the Help text is shown.
    Following How can I get my instructional text to display when I open the pdf? in these streams: Inbox
    |

  • My computer crashed and I lost everything. It was the only computer with Sync on it and I cannot get my recovery key: how can I get all my bookmarks from that Sync account?

    My computer crashed and I lost everything. It was the only computer with Sync on it and I cannot get my recovery key: how can I get all my bookmarks from that Sync account? I have a ton of bookmarks/saved password and the only way to get on sync is create a new recovery key and lose all of my information.
    Is there any way to get my stuff back without creating a new recovery key and losing all my old stuff?

    It has always been very basic to always maintain a  backup copy of your computer for just such an occasion.
    Use your backup copy to put everything back.

  • How can i get HD video out from the lumia 900. ? ...

    How can i get HD video out from the lumia 900. ? Is there some kind of gable. ? N8 has HD cable port..so where is lumia`s port. ?

    Download Zune and start it, when started connect your Lumia 900 and you can now transfer mediafiles from the Lumia to your PC through a USB connection. For Mac use the Mac connector.
    Press the 'Accept As Solution' icon if I have solved your problem, click on the Star Icon below if my advice has helped you!

  • TS4006 My iphone & ipad mini are both here w/ me at my home. But the findme app is showing my ipad mini on the other side of town, how can i get that corrected?

    My iphone &amp; ipad mini are both here w/ me at my home. But the findme app is showing my ipad mini on the other side of town, how can i get that corrected?

    Hello Krazyboutgolf,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS 7: Understanding Location Services
    http://support.apple.com/kb/HT5594
    Improving GPS accuracy2,4
    GPS accuracy varies depending on the number of visible GPS satellites. Locating all visible satellites can take several minutes, with accuracy gradually increasing over time. Use these tips to improve GPS accuracy:
    Ensure the date, time, and time zone are correctly set on the device in Settings > General > Date & Time. If possible, use Set Automatically.
    Important: Incorrect settings on your computer can sync to your device. Verify the date, time, and time zone on any computer that syncs with your device.
    Restart your device.
    Verify that you have a cellular or Wi-Fi network connection. This allows the Assisted GPS (A-GPS) on the device to locate visible GPS satellites faster, in addition to providing initial location information using the Wi-Fi or cellular networks.
    Note: Microcells (sometimes called Femtocells) aren't supported with Location Services.
    Maintain a clear view of the horizon in several directions. Keep in mind that walls, vehicle roofs, tall buildings, mountains, and other obstructions can block line of sight to GPS satellites. When this occurs, your device will automatically use Wi-Fi or cellular networks to determine your position until the GPS satellites are visible again.
    Best of luck,
    Mario

  • My itunes will stop working and shuts down after 5 to 10 minutes playing. I have the most recent updates. How can I repair or correct this from crashing?

    My itunes will stop working and shuts down after 5 to 10 minutes playing. I have the most recent updates. How can I repair or correct this from crashing?

    Hello there, jbenjaminii.
    The following Knowledge Base article offers up some great recommendations for troubleshooting the issue you're describing:
    iTunes for Windows XP: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/ts1421
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How can I get an itunes movie from macbook to apple tv via airplay, how can I get an itunes movie from macbook to apple tv via airplay

    how can I get an itunes movie from macbook to apple tv via airplay?

    You don't use Airplay.  You set up Home Sharing on both and under the Computers section of AppleTV you'll then find it under Movies (or Rentals if rented), assuming it's in a compatible format.
    AC

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can I get audio to play from my TV when using hdmi cable?  Video looks great, just no sound.

    How can I get audio to play from my TV when using hdmi cable?  Video looks great, just no sound.
    I've tried plugging the hdmi into the TV directly and the receiver.
    I get video every time.  HBO to Go , Xfinity, ABC, Youtube, etc...
    just no audio.  Any suggestions? 
    I've tried starting the apps then plugging in the hdmi cable.
    I never tried this before I upgraded to IOS 5.

    Claudiamil-
    I had not tried it with mine since upgrading to iOS 5, so I just did.  I'm using a small Vizio HDTV.  I did not try YouTube, but did try several videos and musical numbers.  In all cases there was sound, including stereo when the source had it.
    I assume you are getting sound from the iPad when the adapter is not connected, so the volume is not turned down.  Dah*veed's suggestion to reset may be what you need.
    Fred

  • How can i get an duplicate invoice from my MacBook which I bought in an independent Apple retail store

    how can i get a duplicate invoice from my MacBook which I bought in an independent Apple retail store in poland

    Call the store & ask the sales staff to send you one if you are no longer in Poland.  If you are still there, what is stopping you from visiting the store? 

  • My hard drive crashed how can i get my old music from my itune account

    my hard drive crashed how can i get my old music from my itune account

    If you have the media on an iDevice then you should be able to get most of your non-iTunes purchases back as well. See this post from forum regular Zevoneer for options.
    tt2

  • My computer broke down and now i bought a new  Mac,  how can i get my music back from iTunes??

    my computer broke down and now i bought a new  Mac,  how can i get my music back from iTunes??

    Unless you subscribe to iTunes Match , Apple does not keep a backup of your iTunes library.  Even then it is not the library as it exists on your computer, but some version of the media, and only media files, not playlists.  Even then not all media are definitely available since anything removed from the iTunes Store since you purchased it is not available for re-download.
    FAQ: Why iTunes Match Can Not Be Used as a Backup - https://discussions.apple.com/docs/DOC-4112
    Using Match as a backup for iTunes - https://discussions.apple.com/message/17039436#17039436
    In your case it sounds like you will have to obtain non iTunes purchases from their original source or a backup you may have made at some time in the past.

Maybe you are looking for