I am reading some Japanese characters from a resource file for my user interface strings. I manually added them to the resource file. They look fine in the resource file and even if I open the resource file using Notepad ++. But when I prepare them in my variables, they turn into question marks. I know that I need to use UTF8 encoding, but where?
I also read lines from an external file (non-resource), and UTF8 encoding works very well.
My suspicion is that it has something to do with the culture property in the resx file. How to change it from “neutral” to “Japanese” (or something else is needed)?
this works (reading from a regular file):
using (StreamReader sr = new StreamReader(inputxliff))
{
data = sr.ReadToEnd();
}
inputxliff.Close();
string filetag = "<file original";
int mycount = (data.Length - data.Replace(filetag, "").Length) / filetag.Length;
string header = getBetween(data, "<?", "<file", true, false);
byte[] bheader = Encoding.UTF8.GetBytes(header);
( resx, ENU DEU, JPN):
using (ResXResourceSet resxSet = new ResXResourceSet(mypath + "\\ResourcesJPN.resx"))
{
string instructions = resxSet.GetString("instructions");
byte[] instrBytes = Encoding.UTF8.GetBytes(instructions);
string myinstructions = Encoding.UTF8.GetString(instrBytes);
.