UTF-8 not working in env variables
See original GitHub issuefile content of testfile
:
my variable is {{ VAR }}
This is working:
VAR="full of joy" j2 testfile
outputs:
my variable is full of joy
This is not working:
VAR="full of ñ" j2 testfile
outputs:
Traceback (most recent call last):
File "/usr/local/bin/j2", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/j2cli/cli.py", line 124, in main
sys.argv[1:]
File "/usr/local/lib/python2.7/dist-packages/j2cli/cli.py", line 114, in render_command
context
File "/usr/local/lib/python2.7/dist-packages/j2cli/cli.py", line 54, in render_template
.render(context) \
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/music/test/j2clitest", line 1, in top-level template code
saludo: {{ hola }}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
UTF-8 not supported in environment variable? - Stack Overflow
Try, specify encoding in property source @PropertySource(value = "classpath:/myprop.properties", encoding="UTF-8").
Read more >Missing UTF-8 support, environment variable LANG not set #279
Environment variable LANG not set, leading to missing UTF-8 support and Jenkins unable to handle non ASCII characters.
Read more >article | How to set up a clean UTF-8 environment in Linux
The following variables can affect programs: LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS ...
Read more >Locale environment variables are not working with SSH
Locale environment variables are not working with SSH ... What if you leave LC_ALL empty and set LANG to C or C.UTF-8?
Read more >Set the NLS_LANG Environment Variable to UTF8
1 Set the NLS_LANG Environment Variable to UTF8. To set an Oracle client application like SQL*Plus to use the right encoding, you must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in the new release
I can confirm it is fixed now on python2.7.