my_wctob.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2003 Mooffie <mooffie@typo.co.il>
  2. //
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
  16. #ifndef MY_WCTOB
  17. #define MY_WCTOB
  18. #include <config.h>
  19. // BTOWC and WCTOB are used for terminal encoding and we assume an iso-8859-8
  20. // encoding if the system lacks them.
  21. #if defined(HAVE_WCTOB) || defined(HAVE_BTOWC)
  22. # include <wchar.h>
  23. #endif
  24. #include "iso88598.h"
  25. #if defined(HAVE_BTOWC)
  26. # define BTOWC(b) btowc(b)
  27. #else
  28. # define BTOWC(b) iso88598_to_unicode(b)
  29. #endif
  30. #if defined(HAVE_WCTOB)
  31. # define WCTOB(w) wctob(w)
  32. #else
  33. # define WCTOB(w) unicode_to_iso88598(w)
  34. #endif
  35. #endif