IdHeaderCoderBig5.pas 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. unit IdHeaderCoderBig5;
  2. interface
  3. {$i IdCompilerDefines.inc}
  4. uses
  5. IdGlobal, IdHeaderCoderBase;
  6. type
  7. TIdHeaderCoderBig5 = class(TIdHeaderCoder)
  8. public
  9. class function Decode(const ACharSet: string; const AData: TIdBytes): String; override;
  10. class function Encode(const ACharSet, AData: String): TIdBytes; override;
  11. class function CanHandle(const ACharSet: String): Boolean; override;
  12. end;
  13. // RLebeau 4/17/10: this forces C++Builder to link to this unit so
  14. // RegisterHeaderCoder can be called correctly at program startup...
  15. {$IFDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
  16. {$HPPEMIT LINKUNIT}
  17. {$ELSE}
  18. {$HPPEMIT '#pragma link "IdHeaderCoderBig5"'}
  19. {$ENDIF}
  20. implementation
  21. uses
  22. SysUtils, IdException;
  23. class function TIdHeaderCoderBig5.Decode(const ACharSet: string; const AData: TIdBytes): String;
  24. begin
  25. Result := '';
  26. ToDo('Decode() method of TIdHeaderCoderBig5 class is not implemented yet'); {do not localize}
  27. end;
  28. class function TIdHeaderCoderBig5.Encode(const ACharSet, AData: String): TIdBytes;
  29. begin
  30. Result := nil;
  31. ToDo('Encode() method of TIdHeaderCoderBig5 class is not implemented yet'); {do not localize}
  32. end;
  33. class function TIdHeaderCoderBig5.CanHandle(const ACharSet: String): Boolean;
  34. begin
  35. Result := TextIsSame(ACharSet, 'Big5');
  36. end;
  37. initialization
  38. RegisterHeaderCoder(TIdHeaderCoderBig5);
  39. finalization
  40. UnregisterHeaderCoder(TIdHeaderCoderBig5);
  41. end.