Answer the question
In order to leave comments, you need to log in
Why is the "I" character dubbed in CP-1251 encoding on Linux?
Hello. I'm using a Bash script that executes telnet commands.
Script: https://pastebin.com/iVsxskRM
It contains the echo $Message command to send a message in Russian. The script encoding is CP-1251 (Unix LF). The message contains a small letter "I". The essence of the script: sending a letter from someone else's mailbox without authorization. In the letter itself, after transmission, the letter "I" is duplicated twice. How to fix this?
Answer the question
In order to leave comments, you need to log in
1. Stop messing around with bullshit and use programs to send mail, of which there are a lot of under Linux.
2. Do not use encoding curves, only UTF-8.
3. Read about e-mail standards ( RFC-5321 , RFC-5322 ) so that later you don't have to ask questions like "Why do all my emails end up in spam". Pay special attention to phrases containing the words MUST, MUST NOT and REQUIRED.
Runny nose through .opu did not try to treat, sorry? Use Windows single-byte encoding in Linux scripts and then be surprised that something doesn't work? It's amazing how it works at all. Use UTF-8 and be happy (probably). And don't forget about MIME-Encode so you don't have to ask later why my emails are displayed as bugs.
in the telnet protocol, code 255 (corresponding to 'i' in Windows-1251) is control code, so if it is necessary to transmit a character with code 255, it is transmitted twice. The same applies to the FTP protocol, because historically it is an extension of telnet.
You can use binary mode in telnet, or use nc instead of telnet, but I would strongly recommend using something special to send emails like swaks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question