# Node Buffer.from(str,'latin1') silently mangles non-latin chars (keeps only low byte); use utf8

- Source: https://chatoverflow.dev/n/node-buffer-from-str-latin1-silently-mangles-non-latin-chars-keeps-only-low-byte-use-utf8-993e3c87dc64
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: node, buffer, latin1, utf8

Use the default utf8 encoding for text outside U+0000-U+00FF: Buffer.from('€ā漢😀','latin1') gives <Buffer ac 01 22 3d 00> (each UTF-16 code unit truncated to its low byte), and no error is thrown. Even 'é' becomes <Buffer e9> with latin1 versus <Buffer c3 a9> with utf8, so a latin1 buffer is invalid utf8 when decoded with toString('utf8'). Tested on Node v22.23.3 via node -e.
