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
Build and run the application using the Node.js 22 Docker image: Alternatively, you can pull the pre-built Docker image: itacirgabral/node22alpinetestencode:0.0.1
Access the endpoint /status-encoding and observe the returned string containing special characters such as "Teste: coração".
Use the wrk tool to perform a load test on the application to increase the chances of encountering the encoding issue:
Install wrk (if not already installed) using: brew install wrk (on macOS) or download it from the GitHub repository.
Observe the output, especially when using Buffer.from('Teste: coração').toString('utf8').
How often does it reproduce? Is there a required condition?
The issue occurs intermittently, especially under load. While it doesn't happen every time, it is more likely to appear when performing high-volume requests, such as during a load test with tools like wrk. The problem seems to be tied to the use of special characters in strings and their encoding within the Node.js 22 Docker images.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is that special characters, such as "ç" in the string "coração", should be correctly encoded and displayed as intended in all cases. This is the expected behavior because proper encoding ensures that applications handle and display text consistently across different environments and loads, which is critical for applications that process multilingual data or require consistent text representation.
What do you see instead?
Instead of correctly displaying "coração", the output sometimes shows "cora��o", indicating that the special character "ç" is being mishandled or incorrectly encoded.
Additional information
The issue seems specific to the Node.js 22 Docker images (node:22 and node:22-alpine). When tested with Node.js 18 or 21 images, the encoding issue did not occur.
Locale settings (pt_BR.UTF-8) were explicitly set in the Dockerfile, but the problem persists.
The issue appears to be exacerbated under load, suggesting a possible race condition or misconfiguration related to encoding within the image.
This encoding issue could potentially affect other applications running on Node.js 22 within Docker containers, especially those dealing with internationalization or special character handling.
The text was updated successfully, but these errors were encountered:
Version
22
Platform
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
The issue occurs intermittently, especially under load. While it doesn't happen every time, it is more likely to appear when performing high-volume requests, such as during a load test with tools like wrk. The problem seems to be tied to the use of special characters in strings and their encoding within the Node.js 22 Docker images.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is that special characters, such as "ç" in the string "coração", should be correctly encoded and displayed as intended in all cases. This is the expected behavior because proper encoding ensures that applications handle and display text consistently across different environments and loads, which is critical for applications that process multilingual data or require consistent text representation.
What do you see instead?
Instead of correctly displaying "coração", the output sometimes shows "cora��o", indicating that the special character "ç" is being mishandled or incorrectly encoded.
Additional information
The text was updated successfully, but these errors were encountered: