ARTICLE AD BOX
I am building a simple java app that uses a few rest webservices (that get parameters from the url) to insert into a database data that is relevant to the progress of some students in a course. This app is to be used by some employees to insert said data as students progress but it has come to my attention that the data (such as the course name) gets altered into funky chars as i have seen happing before, nothing new so far, where it gets interesting is...
If i use UTF-8 encoding (on the webservice) without changes on the frontend (i only use base64 on the frontend to make the strings URL safe) computers where the Windows is in English work well but i get black diamond squares with interrogation points inside if the Windows where the app is being used is in Portuguese. So i tried using ISO-8859-1 instead of UTF-8... now it's the opposite, portuguese Windows work well and English ones don't but i thought UTF-8 was like some sort of super Chartset that it supported everything.
A simple code example here:
the PCourse variable is the course name that i get from the url Paramaters and it is a string encoded in 64 and has the (/)s replaced with (-)s to avoid messing the parameters hence the (re)replace at the end.
byte[] decodedBytes = Base64.getDecoder().decode(Pcourse.replace("-", "/")); course = new String(decodedBytes,"ISO-8859-1");So yeah, my question is, is there a way to force the charset used by the app on the frontend?
I already tried forcing the WhateverTextField.getText() to get a UTF-8 or ISO-8859-1 on the frontend but to no avail, i am not sure if the 64base has something to do with it.
Thanks in advance.
