You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cet_util.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. Character encoding transformation - utilities header
  3. Copyright (C) 2005-2008 Olaf Klein, o.b.klein@gpsbabel.org
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  15. */
  16. #ifndef CET_UTIL_H
  17. #define CET_UTIL_H
  18. #if HAVE_CONFIG_H
  19. #include "config.h"
  20. #endif
  21. #include "cet.h"
  22. cet_cs_vec_t* cet_find_cs_by_name(const QString& name);
  23. void cet_register(void);
  24. void cet_deregister(void);
  25. /* short hand transmissions */
  26. char* cet_str_utf8_to_cp1252(const char* src);
  27. char* cet_str_cp1252_to_utf8(const char* src);
  28. extern cet_cs_vec_t cet_cs_vec_cp1252;
  29. char* cet_str_iso8859_1_to_utf8(const char* src);
  30. char* cet_str_utf8_to_iso8859_1(const char* src);
  31. extern cet_cs_vec_t cet_cs_vec_iso8859_1;
  32. extern cet_cs_vec_t cet_cs_vec_ansi_x3_4_1968;
  33. short* cet_str_utf8_to_uni(const char* src, int* length);
  34. extern cet_cs_vec_t cet_cs_vec_utf8;
  35. /* helpers */
  36. char* cet_str_any_to_any(const char* src, const cet_cs_vec_t* src_vec, const cet_cs_vec_t* dest_vec);
  37. int cet_gbfprintf(gbfile* stream, const cet_cs_vec_t* src_vec, const char* fmt, ...);
  38. /* cet_convert_string: !!! ONLY VALID WITHIN 'cet_convert_strings' process !!! */
  39. char* cet_convert_string(char* str);
  40. const char* cet_convert_string(const QString& str);
  41. /* gpsbabel extensions */
  42. void cet_convert_init(const QString& cs_name, const int force);
  43. void cet_convert_strings(const cet_cs_vec_t* source, const cet_cs_vec_t* target, const char* format);
  44. void cet_convert_deinit(void);
  45. void cet_disp_character_set_names(FILE* fout);
  46. #endif