Note that there are some explanatory texts on larger screens.

plurals
  1. POUnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)
    primarykey
    data
    text
    <p>Sorry for posting this again. I am getting this error <code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)</code> when I run the following code strip_html():</p> <pre><code>from HTMLParser import HTMLParser class MLStripper(HTMLParser): def __init__(self): self.reset() self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): return ''.join(self.fed) def strip_tags(html): s = MLStripper() s.feed(html ) return s.get_data() </code></pre> <p>on this string of text:</p> <pre><code>"&lt;p&gt;We’re implementing the PayPal MECL library in a client’s app but we’re experiencing some poor user experience that we don’t seem to be able to change. \nWhen the PayPal experience is complete, PayPal show a “Please wait while we transfer you to the business site...” message. Obviously this is an iOS app not a “business site”...&lt;/p&gt;\n\n&lt;p&gt;The flow functions by dismissing the web view on completion of the PayPal experience by listening for new URL requests within the UIWebViewDelegate method:&lt;/p&gt;\n\n&lt;pre&gt;&lt;code&gt;- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType\n&lt;/code&gt;&lt;/pre&gt;\n\n&lt;p&gt;This issue seems to be that PayPal update their web view with the message via editing the DOM (JS or some such) which does not create a new web request and therefor no shouldStartLoadWithRequest fired. Note: A new request is made after a second or so when redirected but that’s too late, the inappropriate copy has been presented to the user.&lt;/p&gt;\n\n&lt;p&gt;Has anyone working with MECL on iOS or Android managed to alter this copy/experience either via the &lt;a href=\"https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&amp;amp;content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout\" rel=\"nofollow\"&gt;SetExpressCheckout&lt;/a&gt; server call or configuration of the &lt;a href=\"https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&amp;amp;content_ID=developer/e_howto_api_WPECOnMobileDevices\" rel=\"nofollow\"&gt;MECL URL get params&lt;/a&gt;?I ’ve been unable to find a resolution on this so far but will post a solution if we find one. Any help would be greatly appreciated as we don’t seem to be able to find a solution in PayPals documentation...&lt;/p&gt;\n\n&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Also we have a similar UX issue when pressing the cancel button on the PayPal web view that causes a redirect, but with a similar bad piece of copy presented before hand “Cancel this purchase and return to the seller’s website?”. This is worded as a confirmation dialogue but there are no buttons presented and it redirects anyway. Mad UX. Again if anyone knows a solution to either if these please post.&lt;/p&gt;\n\n&lt;p&gt;&lt;img src=\"http://i.stack.imgur.com/gc4zq.png\" alt=\"&amp;quot;Please wait while we transfer you to the business site...&amp;quot; image\"&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;img src=\"http://i.stack.imgur.com/cztum.png\" alt=\"&amp;quot;Cancel this purchase and return to the seller’s website?&amp;quot; image\"&gt;&lt;/p&gt;\n" </code></pre> <p>I am processing 6 millions documents and so far (10% of the way through) I hit the above error message. I can fix this for the above piece of text if I do <code>a.decode("utf-8")</code> before calling the <code>strip_tags</code> function, but my code for the rest of the text stops working.</p> <p>Any ideas on what I can do? I'm tempted to just use regex to strip the HTML tags (I know that's wrong).</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload