Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to make it Unicode.

I want the text in the texbox of source of Google Translate to go to another Web Browser Control to search for pics of the text in Google Images...

What I have tried:

string query;

try
            {
                query = webBrowserMain.Document.GetElementById("source").GetAttribute("value").Replace(" ", "+");
            }
            catch { }
Posted
Updated 27-Feb-17 11:42am
v3

According to Microsoft documentation, Clipboard.SetText Method (String) (System.Windows)[^] uses UTF16
 
Share this answer
 
Comments
john1990_1 26-Feb-17 12:32pm    
Clipboard is not what I'm talking about, it's about setting the textbox's content in a string called query and then navigating:
webBrowserPics.Navigate("google.com//search?site=&tbm=isch&q=" + query);
Graeme_Grant 26-Feb-17 13:50pm    
yes, well, that was not clear in your question. You need to update it to say "WebBrowser Control", not "webbrowser" - the two are very different.
john1990_1 26-Feb-17 13:52pm    
sorry, done, thx.
Graeme_Grant 26-Feb-17 14:07pm    
Are the results readable? You may need to convert ASCII/UTF8 to UTF16/Unicode before using in the second WebBrowser control. This may help: .net - Unicode-to-string conversion in C# - Stack Overflow[^]
john1990_1 27-Feb-17 11:13am    
The link you gave doesn't explain how to make:
query = webBrowserMain.Document.GetElementById("source").GetAttribute("value").Replace(" ", "+");
and make query string as Unicode and then making a Navigate() to the query as Unicode.
solved with:
WebUtility.UrlEncode
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900