trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.54k stars 3.03k forks source link

Add from_charset function (generic version of from_utf8) #1035

Open electrum opened 5 years ago

electrum commented 5 years ago

This function would allow conversion from binary data in an arbitrary character set to a varchar. Example:

SELECT from_charset('UTF-16BE', from_hex('00680065006C006C006F')); -- 'hello'

Like from_utf8(), this function should have two variants:

ssquan commented 4 years ago

How about changing the order of parameters from charset, binary, replace to binary, charset, replace

AnirudhVyas commented 1 year ago

is utf-16 supported on trino while reading? i see from_utf8 but not utf-16 support anywhere