Skip to main content

Posts

Showing posts with the label java

Encode Unicode character to Utf-8 in url

URLs should only contain ASCII/Unicode charachter. That character set is quite restrictive if you want to use Gujarati characters for instance, so there is some encoding needed here. So if you've got a string with a Gujarati character and you want to link to it, you need to do this: "કળા: -> "%E0%AA%95%E0%AA%B3%E0%AA%BE" Thankfully this can be done with a bit of Java: java.net.URLEncoder.encode("","UTF-8"); So, whenever you need to generate something for the address bar or a direct or something like that, you must URL encode the data. You don't have to detect this as it doesn't hurt to do this for links which are just plain as they don't get changed, as you can see with the string ending

Netbeans Missing New Project Categories

I started it and wanted to start a new project. What a surprise I have seen I could not. There were no menu items besides import existing ant project what I could reach. Holy s.... something! What is this? I was asking. Tried to purge package and reinstall but no luck. So finally I concluded that the problem is around Netbeans 5.5. What can people do than? I have taken the lattes version Netbeans 6.0 and tried. Much more surprise I had the same situation. No menu to create new project. I started to think about some kind of global conspiracy and decided to unveil it so the day just turned darker. Solution: $ rm -rf ~/.netbeans/6.0/config/Modules Simple right? If you are missing New Project Templates in Netbeans and you have started netbeans ever with IcedTea Java 7 - or any other "unsupported one" - first use only SUN Java as long as this error is not corrected to run netbeans. I do not know if this is an error in Iced Tea Java or in Netbeans and do not care too much anymore. ...