now my requirement is to write Japanese text data
Any text is just a set of bytes. You compose those properly in memory, then you write the bytes to file. So, what is your real problem?