'How to treat special character when casting string kdb

When casting a value to a string (via "string" keyword)

 Ex.
 t:([]stuff:`a`b`c)
 select string stuff from t 
 

Adds a weird special character before final 0a when calling from k function (via C client)

 0x0180

What is this ? What is best way of handling it ? Is there anyway to get a string without this special character ?

 stuff,more
 a,1.2�
 b,2.3�
 c,3.4�


Solution 1:[1]

The special character does not appear in a q session

q)select string stuff from t
stuff
-----
,"a"
,"b"
,"c"

so one supposes your problem arises from the C API. Not being familiar with the API, the rest of this is speculative. Sorry.

If you are working through the API, perhaps you do not need a table returned, only the column values. Is exec perhaps closer to what you want?

q)exec string stuff from t
,"a"
,"b"
,"c"

If so, do you still see the character you ask about?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SJT