use C# connector to insert Chinese into TDengine 2.4.0.16 but got Illegal byte sequence

26 Views Asked by At

use TDengine.Query(conn, commandText);

It returned intPrt value is not 0, TDengine.Error() show Illegal byte sequence

anyone know how to resolve?

1

There are 1 best solutions below

0
xiaolei On

This should happened under windows. This is because in Windows, C# using UFT-16. That means the parameter commandText is in UFT-16. However lib.taos accpet UTF-8 input. You need to change the `commandText in UTF-8.