I'm working on an InSim and used to store data via a PHP webservice through C#. I would post data to the .php file and retrieve data as well. This obviously is not really efficient, so I've moved to a remote MySQL (my host does not have a database to use) database to store data.
When I retrieve players with special characters in their names something weird is happening.
In the database it's saved as: ^5★^7BattleStar. When I paste the above text in a /msg or whatever it shows the correct name. However, when I retrieve the data from the database and show it in LFS it goes wrong. Check the attachment to see what I mean:
The name is saved from the previous method where I posted to a PHP file, which then inserted it in the database. When I retrieved it with the database - > php -> insim method it showed fine. However, when I now try via the database -> insim method, it shows it differently.
I execute my query and then put it in a MySQLDataReader:
and show the record with this in a while loop:
The Database is in UTF8 charset, and also when connecting to the MySQL database (via the connector from MySQL), I have set the CharSet=utf8. I've tried pretty much all Encoding settings, but I just can't figure out how to solve this.
It seems like the output is the same as the actual database record if you look in plain text, instead of it being the star (in this case) that LFS has. This goes for all special characters. Normal characters work fine.
Does anyone have an idea?
When I retrieve players with special characters in their names something weird is happening.
In the database it's saved as: ^5★^7BattleStar. When I paste the above text in a /msg or whatever it shows the correct name. However, when I retrieve the data from the database and show it in LFS it goes wrong. Check the attachment to see what I mean:
The name is saved from the previous method where I posted to a PHP file, which then inserted it in the database. When I retrieved it with the database - > php -> insim method it showed fine. However, when I now try via the database -> insim method, it shows it differently.
I execute my query and then put it in a MySQLDataReader:
MySqlDataReader reader = cmd.ExecuteReader();
and show the record with this in a while loop:
reader.GetString("playername")
The Database is in UTF8 charset, and also when connecting to the MySQL database (via the connector from MySQL), I have set the CharSet=utf8. I've tried pretty much all Encoding settings, but I just can't figure out how to solve this.
It seems like the output is the same as the actual database record if you look in plain text, instead of it being the star (in this case) that LFS has. This goes for all special characters. Normal characters work fine.
Does anyone have an idea?