I think another qustion about converting to a different encoding was answered in the forum recently; you may try to search for that.
I believe you can use new InputStreamReader(FileInputStream, "WIN-1251") and then String.getBytes("UTF-8") on a String read from input, and then write the bytes to output. The encoding name may not be "WIN-1251". While this may not be enough to solve your problem, I hope it points in the right direction.