Jump to content
  • Advertisement
Sign in to follow this  
Cybrosys

[.net] Special characters

This topic is 4723 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all I just descided to write a small search app that i could use to help facilitate my searching. At first i thought about displaying the search results in the app but that's way to advanced for me seeing as i'd have to know how to implement an internet explorer window in my app which i have no idea how to do. (If you know how, feel free to post information, i'm hoping that a suitable control will be available in Forms 2.0 in VS 2005) In any case, in the swedish language and others we have 3 extra characters, Å, Ä and Ö. If they're not displayed properly the first one is an A with 1 dot over it's head. The second is an A with 2 dots over it's head, located beside each other. The third is an O with 2 dots located beside each other. Here's the problem, htm(l) and misc has certain keycodes for these characters, and when searching in google they're converted. For example, "Fält", would be converted into, "f%C3%A4lt". I'm wondering if there's any built-in support of doing this or if i'm going to have to search the search query for these characters? (If so, how could i do this the fastest?)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Cybrosys
Hi all

I just descided to write a small search app that i could use to help facilitate my searching. At first i thought about displaying the search results in the app but that's way to advanced for me seeing as i'd have to know how to implement an internet explorer window in my app which i have no idea how to do. (If you know how, feel free to post information, i'm hoping that a suitable control will be available in Forms 2.0 in VS 2005)

In any case, in the swedish language and others we have 3 extra characters, Å, Ä and Ö. If they're not displayed properly the first one is an A with 1 dot over it's head. The second is an A with 2 dots over it's head, located beside each other. The third is an O with 2 dots located beside each other.

Here's the problem, htm(l) and misc has certain keycodes for these characters, and when searching in google they're converted.

For example, "Fält", would be converted into, "f%C3%A4lt". I'm wondering if there's any built-in support of doing this or if i'm going to have to search the search query for these characters? (If so, how could i do this the fastest?)


Look up the WebBrowser control. It can display HTML. Also, strings in .Net are unicode by default (UTF-8, although you can change that as well).

Share this post


Link to post
Share on other sites
Thanks for the fast reply. I'll check up the control. The problem is that when searching normally at google's main site it converts the character(s) before sending them off to the main search engine.

Another misc problem i'm having is that i've overloaded my main form's KeyDown event but it never gets the event, the textboxes doesn't pass it down to the main form.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cybrosys
Thanks for the fast reply. I'll check up the control. The problem is that when searching normally at google's main site it converts the character(s) before sending them off to the main search engine.

Another misc problem i'm having is that i've overloaded my main form's KeyDown event but it never gets the event, the textboxes doesn't pass it down to the main form.


The control with the focus handles it. If you want to dispatch it to the main form, you'll have to manually do that.

Share this post


Link to post
Share on other sites
Yes but i was hoping that if the e.Handled was set to false it'd be passed to the parent, but so far that's not working out for me =)

Share this post


Link to post
Share on other sites
Also, the reason they are converted to that is just the way it works. The %<num>%<num> is because they are unicode characters. The numbers are hexidecimal in nature, so if you can convert each non-ansi character to hex, then you could simply do the translation manually (HtmlEncode should be able to do it as well, however that would require an ASP.Net server object.)

Share this post


Link to post
Share on other sites
Thanks, while you're here answering, i hope i'm not being a bother, i'd like some information on sending an app to the system tray =)

Share this post


Link to post
Share on other sites
Sorry for being a bit of a nuisance, heading over to google to find some more info but in the mean time i can't find the WebBrowser control. I've gone through the list that pops up when selecting add/remove items to the windows forms list but i can't find WebBrowser control from the .Net Framework components, sorry.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!