pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r4142 - branches/pingus-hanusz/src/tinygettext


From: grumbel
Subject: [Pingus-CVS] r4142 - branches/pingus-hanusz/src/tinygettext
Date: Thu, 12 May 2011 16:42:26 +0200

Author: grumbel
Date: 2011-05-12 16:42:26 +0200 (Thu, 12 May 2011)
New Revision: 4142

Modified:
   branches/pingus-hanusz/src/tinygettext/iconv.cpp
   branches/pingus-hanusz/src/tinygettext/iconv.hpp
   branches/pingus-hanusz/src/tinygettext/po_file_reader.cpp
Log:
Use SDL_iconv instead of iconv for better portability

Modified: branches/pingus-hanusz/src/tinygettext/iconv.cpp
===================================================================
--- branches/pingus-hanusz/src/tinygettext/iconv.cpp    2011-05-12 14:41:33 UTC 
(rev 4141)
+++ branches/pingus-hanusz/src/tinygettext/iconv.cpp    2011-05-12 14:42:26 UTC 
(rev 4142)
@@ -24,6 +24,9 @@
 #include <stdexcept>
 #include <string.h>
 #include <stdlib.h>
+//#include <iconv.h>
+#include <SDL_stdinc.h>
+
 #include "iconv.hpp"
 
 namespace TinyGetText {
@@ -37,7 +40,7 @@
     m_conv(0)
 {
   // Create the converter.
-  if(!(m_conv = iconv_open(to_charset.c_str(), from_charset.c_str())))
+  if(!(m_conv = SDL_iconv_open(to_charset.c_str(), from_charset.c_str())))
     {
       if(errno == EINVAL)
         {
@@ -66,7 +69,7 @@
   // Free, if exists.
   if(m_conv)
     {
-      iconv_close(m_conv);
+      SDL_iconv_close(m_conv);
       m_conv = 0;
     }
 }
@@ -84,7 +87,7 @@
   char* out_str = &result[0];
  
   // Try to convert the text.
-  if(iconv(m_conv, &in_str, &in_size, &out_str, &out_size) != 0) {
+  if(SDL_iconv(m_conv, &in_str, &in_size, &out_str, &out_size) != 0) {
     std::cout << "TinyGetText: text: \"" << text << "\"" << std::endl;
     std::cout << "TinyGetText: Error while converting (" 
               << from_charset << " -> " << to_charset 

Modified: branches/pingus-hanusz/src/tinygettext/iconv.hpp
===================================================================
--- branches/pingus-hanusz/src/tinygettext/iconv.hpp    2011-05-12 14:41:33 UTC 
(rev 4141)
+++ branches/pingus-hanusz/src/tinygettext/iconv.hpp    2011-05-12 14:42:26 UTC 
(rev 4142)
@@ -21,7 +21,8 @@
 #define HEADER_ICONV_HPP
 
 #include <string>
-#include <iconv.h>
+//#include <iconv.h>
+#include <SDL.h>
 
 namespace TinyGetText {
 
@@ -30,7 +31,7 @@
 public:
   std::string to_charset;
   std::string from_charset;
-  iconv_t m_conv;
+  SDL_iconv_t m_conv;
 
   IConv();
   IConv(const std::string& fromcode, const std::string& tocode);

Modified: branches/pingus-hanusz/src/tinygettext/po_file_reader.cpp
===================================================================
--- branches/pingus-hanusz/src/tinygettext/po_file_reader.cpp   2011-05-12 
14:41:33 UTC (rev 4141)
+++ branches/pingus-hanusz/src/tinygettext/po_file_reader.cpp   2011-05-12 
14:42:26 UTC (rev 4142)
@@ -19,7 +19,6 @@
 
 #include <config.h>
 #include <vector>
-#include <iconv.h>
 #include <errno.h>
 #include <sstream>
 #include <stdexcept>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]