I am writing code to provide support for multiple currencies in my project. Below is my method:
Locale l = new Locale.Builder().setLanguage(getLocaleLanguage()).setRegion(getLocaleCountry()).build();
if(Currency.getInstance(l).getSymbol().equals("Rs.")) {
return "u20B9";
}
return Currency.getInstance(l).getSymbol(l);
}
Now, when in the excel cell format style, I am providing currency like this:
cellStyle.setDataFormat(dataFormat.getFormat(currencySymbol + "#,##0.00;-" + currencySymbol + "#,##0.00"));
So, when I download excel file in the windows machine which I am using it works perfectly fine. But in the staging environment with Amazon linux machine, it’s downloading corrupted excel file and after recovering excel it removes rupees symbol from all the places. And no error is being thrown in the logs as well.
Note: This issue is occurring only for the Indian Rupees symbol.