You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Linux (inside Docker container), AWS Cloud (ECS, EC2) and localhost
Docker Version: any
Node.js Version: node:22
Image Tag: node:22-alpine, node:22-bullseye
Expected Behavior
Special characters should be correctly encoded and displayed as "Teste: coração" in all instances.
Current Behavior
When handling special characters like "ç" in strings, the characters are sometimes improperly encoded or displayed as garbled text.
Possible Solution
Downgrade Node.js Version: As a temporary fix, you can switch to Node.js 18 or 21 Docker images where the encoding issue does not occur.
Investigate Locale Settings: Although I tried setting locale environment variables, further investigation into locale handling within the Node.js 22 Docker images might reveal a more permanent solution.
Rebuild Docker Image: Consider rebuilding the Docker image with a different base OS that handles locales differently, or try explicitly setting the encoding in your Node.js application to ensure consistent behavior.
Observe the output, especially when using Buffer.from('Teste: coração').toString('utf8').
Additional Information
I tested the same application with Node.js 18 and 21 Docker images and did not encounter the issue. It seems specific to the Node.js 22 images.
Locale settings attempted: pt_BR.UTF-8, LC_ALL=pt_BR.UTF-8, LANG=pt_BR.UTF-8
I tried setting various locale environment variables (e.g., LANG, LC_ALL, LC_CTYPE), but the issue persisted. This suggests the problem might be related to the Node.js 22 Docker image itself.
The text was updated successfully, but these errors were encountered:
I'm sure. I ran the same code, with the same environment with both images, one breaks and the other doesn't.
I noticed this issue when I pushed a code change to production that included a single line that added a phone number to messageBird. It shouldn't break, it was the same infrastructure.
#2135 (comment)
22.8 didn't land upstream till after you opened this, and it may resolve the issue, by as like the other issue, this is an upstream issue that nothing in this repo can fix
Environment
Expected Behavior
Special characters should be correctly encoded and displayed as "Teste: coração" in all instances.
Current Behavior
When handling special characters like "ç" in strings, the characters are sometimes improperly encoded or displayed as garbled text.
Possible Solution
Downgrade Node.js Version: As a temporary fix, you can switch to Node.js 18 or 21 Docker images where the encoding issue does not occur.
Investigate Locale Settings: Although I tried setting locale environment variables, further investigation into locale handling within the Node.js 22 Docker images might reveal a more permanent solution.
Rebuild Docker Image: Consider rebuilding the Docker image with a different base OS that handles locales differently, or try explicitly setting the encoding in your Node.js application to ensure consistent behavior.
Steps to Reproduce
GitHub Repository
Alternatively, you can pull the pre-built Docker image: itacirgabral/node22alpinetestencode:0.0.1
Additional Information
I tested the same application with Node.js 18 and 21 Docker images and did not encounter the issue. It seems specific to the Node.js 22 images.
Locale settings attempted: pt_BR.UTF-8, LC_ALL=pt_BR.UTF-8, LANG=pt_BR.UTF-8
I tried setting various locale environment variables (e.g., LANG, LC_ALL, LC_CTYPE), but the issue persisted. This suggests the problem might be related to the Node.js 22 Docker image itself.
The text was updated successfully, but these errors were encountered: