我想在这个小代码中添加 UTF8 编码:
\o page_html.html --output of the psql command
\pset format html
\pset border 1
\pset charset 'utf-8'
\pset title 'Liste des employés' --note here the character 'é'
\pset tableattr align='center'
--\pset charset 'utf-8' ?? (something like this)
SELECT jobtitle FROM employee;
\o
我没有找到与\pset 命令关联的命令字符集
最佳答案
你可以像这样为 psql 指定一个字符集:
\encoding utf8
使用不带参数的\encoding
来显示当前设置。
通常 psql 会从区域设置(Unix 上的 LC_CTYPE 或 LANG 环境变量)自动检测客户端编码。
关于html - PSQL输出html格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34837793/