2023.03.29 09:20 AM
Hi,
While i was trying to convert the unicode character of ô it is showing a different number.
q)`$`char$147
`ô
q)`$`char$244
`⌠
I could see the ASCII value for ô is 244 but when i try it in the q terminal it is showing a different result as mentioned above. Also you could see the value of 147 gives me the expected result as ô. I am not sure what is happening behind this.
2023.03.29 10:00 AM
Most modern shells will be UTF-8 encoded rather than ASCII.
kdb+ is storing the information correctly - it is just being displayed differently than you expect.
On my machine:
$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
UTF-8 encoding for ô is 0xC3 0xB4
Testing this in kdb+
q)`char$0xC3B4
"\303\264"
q)`$`char$0xC3B4
`ô
For your shell to print the extended ASCII table characters you will need to make some changes outside of kdb+.
2023.03.29 10:00 AM
Most modern shells will be UTF-8 encoded rather than ASCII.
kdb+ is storing the information correctly - it is just being displayed differently than you expect.
On my machine:
$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
UTF-8 encoding for ô is 0xC3 0xB4
Testing this in kdb+
q)`char$0xC3B4
"\303\264"
q)`$`char$0xC3B4
`ô
For your shell to print the extended ASCII table characters you will need to make some changes outside of kdb+.
2023.03.30 01:34 AM
Excellent thanks, that helps.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.