[Webkit-unassigned] [Bug 26791] [Gtk] Paste of rich text from firefox results garbled markup
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jul 3 08:33:33 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=26791
Jiahua Huang <jhuangjiahua at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #32072|0 |1
is obsolete| |
Attachment #32238| |review?
Flag| |
--- Comment #20 from Jiahua Huang <jhuangjiahua at gmail.com> 2009-07-03 08:33:33 PDT ---
Created an attachment (id=32238)
--> (https://bugs.webkit.org/attachment.cgi?id=32238)
use TextResourceDecoder instead of simple detectTextEncoding
change to this code:
> String html;
> RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/html", "UTF-8", true);
> html = decoder->decode(reinterpret_cast<char*>(data->data), data->length);
it works.
GtkSelectionData (html) from GTK clipboard can be some forms:
1. From other WebkitGtk page
"text/html", 8bits, utf-8, no BOMs
2. From FireFox page
"text/html", 8bits (wrong for firefox), utf-16, BOMs
3. From Pidgin messageview
"text/html", 16bits, BOMs
4. From other Gtk App who use "text/html" when copy-paste
"text/html", 8bits, utf-8, no BOMs
...
it use TextResourceDecoder to auto detect encoding.
--
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