Swedish letters fuck up parsing into SQL querry

Anders S anders at xore.se
Mon Mar 23 13:49:43 UTC 2020


Hi guys,

I'm trying to read a name from a struct iorequest where the name 
is char name[20]
The struct is received through a FIFO pipe and message is going 
into a mysql database to update specific post there.

Now my problem is that all works fine to read and stop with  '\0' 
termination till I receive a Swedish character, ie åäö. Then the 
string gets crazy and reads all 20 chars no matter what.

Any ideas how to read all chars including åäö?

Using "~ to!string(name) ~" to build the SQL querry string as 
below

int extract_Cell_From_IOREQ(int CellIndex){
      auto sql =    "UPDATE celldata set
                 name='"~ to!string(cellTab[CellIndex].name) ~"', 
...


More information about the Digitalmars-d-learn mailing list