I programmed a telnet server using C as programming language but I have a problem to send characters with emphases (é, è, à …). The character encoding is different between the telnet clients (windows, linux, putty, …).
What can I do to detect the character encoding of the clients which are connected to my server ?
Guessing the encoding of a message based on its byte values is always imperfect, although it can be made to give relatively accurate results. There are libraries available to do this, e.g. IBM’s ICU.
But the preferable option is always either to standardize client and server on one encoding and always use that, or to force the client to declare the encoding of messages explicitly. It requires only a little programming effort and solves the entire question once and for all.
2
You are pretty much stuck which something hokey like sending:
Which character looks like e with an acute accent:
1 -> è, 2 -> ò, 3 -> õ, 4 -> é, 5 -> none of these
enter choce 1-5: