Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How I can decode TIdMessage from koi8-r to windows-1251?
#4
(08-30-2018, 12:44 PM)SergJP Wrote: In my test application coders are loaded in order:

TIdHeaderCoderPlain
TIdHeaderCoderIndy
TIdHeaderCoder2022JP

...

When I use this in my main project order of coders is other:

TIdHeaderCoderIndy
TIdHeaderCoder2022JP
TIdHeaderCoderPlain

Known issue for C++.

If you use only #include <IdAllHeaderCoders.hpp>, rather than #include'ing individual IdHeaderCoderXXX.hpp files, Indy registers the coder classes in this order:

TIdHeaderCoderPlain
TIdHeaderCoder2022JP
TIdHeaderCoderIndy

(08-30-2018, 12:44 PM)SergJP Wrote: What can I do?

Make sure #include <IdHeaderCoderIndy.hpp> is the last header seen by the compiler.  Or use only #include <IdAllHeaderCoders.hpp> instead.  Or manually unregister and re-register the coder classes in the desired order at runtime using the UnregisterHeaderCoder() and RegisterHeaderCoder() functions declared in IdHeaderCoderBase.hpp.

Also, do note that the entire header coder system is slated to be removed in a future version of Indy (it is already removed in my dev copy), so this won't be an issue for much longer:

#44 Remove IdHeaderCoder sub-system

Reply


Messages In This Thread
RE: How I can decode TIdMessage from koi8-r to windows-1251? - by rlebeau - 08-30-2018, 06:38 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)