I think you have something mixed up here. Server encoding does not matter to the client, and it should not. This is what RFC 2109 is trying to say here.
The concept of cookies in http is similar to this in real life: after paying the entrance fee to the club, you get an ink stamp on your wrist. This allows you to leave and re-enter the club without paying once again. All you have to do is show your wrist for the bouncer. In this real-life example, you don't care what it looks like, it may even be invisible in a normal light - all that matters is that the bouncer recognizes the thing. If you were to wash it, you would lose the privilege of re-entering the club without paying even more.
In HTTP, the same thing happens. The server sets a cookie with a browser. When the browser returns to the server (read the following HTTP request), it will display a cookie on the server. The server recognizes the cookie and acts accordingly. Such a cookie can be as simple as the “WasHereBefore" token. Again, it doesn’t matter that the browser understands what it is. If you delete your cookie, the server will act as if it had never seen you before, just like a bouncer in this club if you washed away this ink stamp.
Today, many cookies store only one important information: session ID. Everything else is stored on the server side and is associated with this session identifier. The advantage of this system is that the actual data never leaves the server and, as such, can be trusted. Everything that is stored on the client side can be changed and should not be trusted.
Edit: After reading your comment and re-reading your question, I think I finally understood your situation and why you are interested in the actual encoding of the cookie, and not just leave it in your programming language. If there are two different software environments on the same server (for example, Perl and PHP), you might want to decode a cookie that was set in a different language. In the above example, PHP should decode the Perl cookie or vice versa.
There is no standard in how data is stored in a cookie. The standard only says that the browser will send the cookie exactly as it was received. The coding scheme used depends on your programming language.
Returning to the example of real life, you now have two bouncers, one of whom speaks English, the other speaks Russian. Both will have to agree on one type of ink. Most likely, this will lead to the fact that at least one of them learns another language.
Since the behavior of the browser is standardized, you can either simulate the coding scheme of one language in all other languages that are used on your server, or simply create your own standardized coding scheme in all the languages used. You may need to use lower-level routines such as PHP header() instead of higher-level start_session() such as start_session() .
BTW: In the same way, the server-side programming language decides how to store session data on the server side. You cannot access Perl CGI::Session with the PHP $_SESSION .