I am developing a tool using java swing. In it I have to read a .vbs file. I have used the following code for it.
Scanner fileReader1 = new Scanner(new File(fileName),"US-ASCII");
while (fileReader1.hasNext())
{
System.out.println(fileReader1.nextLine());
}
where fileName is valid .vbs file path
This is working only for .vbs files in my PC. For other systems, .vbs files are not opening. I think the problem is due the change in charset. For me it is "US -ASCII" and for others it may be "UTF 8" or "UTF 16". So how can I resolve this problem? My purpose is to open .vbs file using my tool for any systems. What I have to do for this? which charset will work for all systems ? please help.........