Skip to main content

VSQL error: unsupported locale character encoding

  • October 31, 2014
  • 2 replies
  • 19 views

reece_k
OSX 10.10. Getting an error when running the vsql process from Python in both 7.X and 6.X client tools:
vsql: unsupported locale character encoding.   Use a utf8 locale, not a US-ASCII locale
Here's the command I'm running:
/opt/vertica/bin/vsql  -h ## -p ## -U ## -w # -d # -At -c "SELECT * FROM MY_SCHEMA.MY_TABLE"
This command works perfectly when executed from the Terminal, just fails with that error when ran via Python. It even fails when the command is simply to run the vsql executable with no params:
CMDstr = '/opt/vertica7/bin/vsql'  result,error = Popen(CMDstr, shell=True, stdout=PIPE,  stderr=PIPE).communicate()  print(error)   # yields above err  
Anyone seen this error before?

2 replies

reece_k
  • Author
  • New Participant
  • October 31, 2014
Solved by prefixing CMDstr to set LANG, i.e.
CMDstr = 'export LANG=en_US.UTF-8 && /opt/vertica7/bin/vsql (...)'

Subbarao
  • New Participant
  • July 31, 2015

Tried changing the locale settings.. but in-vain and encountering the below error

 

$./vsql      
Invalid locale: run the "locale" command and check for warnings
$locale
LANG=en_US.UTF-8
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=en_US.UTF-8
$