Bahmni Reports - Special characters are not appearing properly in any of the format(HTML/CSV)

Hi All,

We are working on one of the implementations of Bahmni in French language. So we use Bahmni in French, similarly we have some of the custom sql reports as well in French. When we run the reports the special characters in French like (è) are not appearing properly on UI. We tried the sample report on Product as well, it is the same issue. We are looking for a solution where we can display these characters properly.

Any suggestions on how to solve this would be helpful.

@angshuonline @shruthipitta @darius

Screenshot attached for reference:


Some findings based on our investigation so far:

  • These are not the values coming from database, but these are the values which we have mentioned in the sql file. For eg: if the age is 23 years 0 Months then we converted to 23 années 0 Mois in sql.
  • Once we reboot the system after running Bahmni installer, the characters are coming properly.

The layer that generates the responses out of the SQL queries results is likely not encoding its content as UTF-8. Could you dig in and search for the responsible webservices?

We stumbled upon something similar with Idgen Web Services, see this correcting commit.

While reading the file we are directly getting the bytes and constructing the string without the conversion here. We need to use alternative String constructor(public String(byte bytes[], Charset charset)) where we can specify the charset encoding.

Thanks for doing the research @shruthipitta.

@padmavati, can you create a JIRA ticket and send a pull request for this product fix?

Pushed the fix to master: as I had fixed it locally.