Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread Anders S via Digitalmars-d-learn
On Tuesday, 24 March 2020 at 14:10:19 UTC, WebFreak001 wrote: On Tuesday, 24 March 2020 at 11:15:24 UTC, matheus wrote: On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: I'm creating a connection to the db and

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 24 March 2020 at 11:15:24 UTC, matheus wrote: On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: I'm creating a connection to the db and conn.exec(sql) It depends on the library but it is almost always easier

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/24/20 7:15 AM, matheus wrote: On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: I'm creating a connection to the db and conn.exec(sql) It depends on the library but it is almost always easier to do it right than to

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread matheus via Digitalmars-d-learn
On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: I'm creating a connection to the db and conn.exec(sql) It depends on the library but it is almost always easier to do it right than to do it the way you are. like with

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: On Monday, 23 March 2020 at 15:07:31 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: do you mean I should loop through each pos till strlen(cellTab[CellIndex].name) to find "\0"? strlen is ok, that

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Anders S via Digitalmars-d-learn
On Monday, 23 March 2020 at 15:07:31 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: do you mean I should loop through each pos till strlen(cellTab[CellIndex].name) to find "\0"? strlen is ok, that gives the answer itself. Just slice to that.

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Anders S via Digitalmars-d-learn
On Monday, 23 March 2020 at 14:58:03 UTC, bauss wrote: On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote: My first thought is to!string(cellTab[CellIndex].name) is wrong, if it is a char[20] you should be scanning it to find

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: do you mean I should loop through each pos till strlen(cellTab[CellIndex].name) to find "\0"? strlen is ok, that gives the answer itself. Just slice to that. cellTab[CellIndex].name[0 .. strlen(cellTab[CellIndex].name.ptr)] could do

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread bauss via Digitalmars-d-learn
On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote: My first thought is to!string(cellTab[CellIndex].name) is wrong, if it is a char[20] you should be scanning it to find the length and slicing. Maybe [0 ..

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Anders S via Digitalmars-d-learn
On Monday, 23 March 2020 at 13:53:50 UTC, Adam D. Ruppe wrote: My first thought is to!string(cellTab[CellIndex].name) is wrong, if it is a char[20] you should be scanning it to find the length and slicing. Maybe [0 .. name.indexOf("\0")] or whatever. You also shouldn't be building a query by

Re: Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Adam D. Ruppe via Digitalmars-d-learn
My first thought is to!string(cellTab[CellIndex].name) is wrong, if it is a char[20] you should be scanning it to find the length and slicing. Maybe [0 .. name.indexOf("\0")] or whatever. You also shouldn't be building a query by concatenation.

Swedish letters fuck up parsing into SQL querry

2020-03-23 Thread Anders S via Digitalmars-d-learn
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