UTF8
UTF8
fromUtf8과 toUtf8 함수는 바이너리 데이터를 UTF-8 문자열로 인코딩하거나 디코딩하는 함수예요.
출처: 문서
본문
fromUtf8은 입력 바이너리 데이터(bytes타입)를 UTF-8 인코딩한 문자열로 반환해요.toUtf8은 UTF-8 인코딩 문자열에서 바이너리 데이터(16진수 문자열로 표현)를 반환해요.
시그니처 (Signature)
fromUtf8(bytesCol)
toUtf8(string)
사용 예시 (Usage Examples)
SELECT bytesCol1, fromUtf8(bytesCol1) AS utf8Str
FROM testTable
LIMIT 1
| bytesCol1 | utf8Str |
|---|---|
| 68656c6c6f21 | hello! |
SELECT toUtf8('hello!') AS binaryOutput
FROM ignoreMe
| binaryOutput |
|---|
| 68656c6c6f21 |