[Webkit-unassigned] [Bug 77294] [Chromium] Copy and paste of HTML content with non-breaking space misbehaves

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 2 10:04:21 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=77294





--- Comment #13 from Charles Pritchard <chuck at jumis.com>  2012-05-02 10:04:21 PST ---
(In reply to comment #12)
> It's a non-breaking space. I don't think this is a bug. See https://developer.mozilla.org/en/DOM/window.btoa

What's your recommendation? I'd like to maintain exact fidelity with what the user has pasted. In this case, the non-breaking space is showing up as an unrecognized character instead of acting as a non-breaking space. While I can certainly use CSS as a work-around, it seems like we shouldn't be seeing that missing glyph symbol.

As far as I know, my base64 encoding functions work correctly with binary data. Perhaps I still have some conversion errors in them.

var base64encode =
function(a,b,c,d,e,f){b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(d=f='';e&=3,a[d++]||(b='=',e);f+=b[63&c>>++e*2])c=c<<8|a.charCodeAt(d-=!e);return f};

document.onpaste = function(a) {
        var clipboard = a ? (a.dataTransfer || a.clipboardData) : a;  
        var html = clipboard.getData('text/html');
        window.open('data:text/html;charset=utf-8;base64,' + base64encode(html));
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list