Closed
Bug 84240
Opened 23 years ago
Closed 23 years ago
no way to get unicode js_status and link_message
Categories
(Core Graveyard :: Embedding: APIs, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ftang, Assigned: blizzard)
Details
(Whiteboard: have patch; r=philipl sr=shaver; ready to checkin)
Attachments
(2 files)
2.06 KB,
patch
|
Details | Diff | Splinter Review | |
2.09 KB,
patch
|
Details | Diff | Splinter Review |
this is a spin off from 79041 When I read /embedding/browser/gtk/src/gtkmozembed2.cpp I found some illegal usage of ToNewCString- Bascailly, ToNewCString should not be used for any string which could possible contains non ASCII data. both js status and link message is possible to contains non ASCII data, there fore these two api is not good. 833 char * 834 gtk_moz_embed_get_link_message(GtkMozEmbed *embed) 835 { 836 char *retval = nsnull; 837 EmbedPrivate *embedPrivate; 838 nsXPIDLCString embedString; 839 840 g_return_val_if_fail ((embed != NULL), (char *)NULL); 841 g_return_val_if_fail (GTK_IS_MOZ_EMBED(embed), (char *)NULL); 842 843 embedPrivate = (EmbedPrivate *)embed->data; 844 845 if (embedPrivate->mWindow) { 846 *getter_Copies(embedString) = 847 ToNewCString(embedPrivate->mWindow->mLinkMessage); 848 retval = strdup(embedString); 849 } 850 851 return retval; 852 } 853 854 char * 855 gtk_moz_embed_get_js_status(GtkMozEmbed *embed) 856 { 857 char *retval = nsnull; 858 EmbedPrivate *embedPrivate; 859 nsXPIDLCString embedString; 860 861 g_return_val_if_fail ((embed != NULL), (char *)NULL); 862 g_return_val_if_fail (GTK_IS_MOZ_EMBED(embed), (char *)NULL); 863 864 embedPrivate = (EmbedPrivate *)embed->data; 865 866 if (embedPrivate->mWindow) { 867 *getter_Copies(embedString) = 868 ToNewCString(embedPrivate->mWindow->mJSStatus); 869 retval = strdup(embedString); 870 } 871 872 return retval; 873 } to fix it, you can choose to add additional unicode version like what you did in 79041 . add gtk_moz_embed_get_js_status_unichar and gtk_moz_embed_get_link_message_unichar
Reporter | ||
Comment 1•23 years ago
|
||
eungkyu@sparcs.org (Eungkyu Song) do you have good test cases in galeon, nautilus, ... (embedding mozilla) to test js_status and link_message?
Assignee | ||
Comment 2•23 years ago
|
||
I've never gotten feature requests for uncidode friendly apis so I've never implemented them. It would be trivial to add functions to gtkmozembed_internal.h in the style of gtk_moz_embed_get_title_unichar().
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•23 years ago
|
||
Comment 5•23 years ago
|
||
Looks good to me. r=philipl
Updated•23 years ago
|
QA Contact: mdunn → dsirnapalli
Assignee | ||
Updated•23 years ago
|
Whiteboard: have patch; r=? sr=? → have patch; r=philipl sr=?
Comment on attachment 41601 [details] [diff] [review] patch Can we name the methods _ucs2 instead of unichar? (Which might be UTF-16 or UTF-8 or wchar_t on Linux.) I'd sr=shaver a renamed patch in a flash. =)
Assignee | ||
Comment 7•23 years ago
|
||
Talked shaver down. I have an sr=shaver now.
Whiteboard: have patch; r=philipl sr=? → have patch; r=philipl sr=shaver; ready to checkin
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•