More about Ports

Learn about zombie processes and pools in this lesson.

All caps and Unicode

When converting all_caps.exs to use packets, notice we receive the message length, convert the message to all caps, and then compute a new message length. However, you may be wondering:

“Won’t the returned message have the same length as the incoming message?”

The answer might surprise you. Since the String module works on Unicode, it will upcase not only ASCII characters, but also many other characters. One such character is the Latin ligature ff, represented by the codepoint FB00, which occupies three bytes. When converted to uppercase, ff becomes FF, which is the ASCII letter F twice, represented by the codepoint 0046, which takes two bytes.

Get hands-on with 1200+ tech skills courses.