Gammu internals  1.38.0
gammu-unicode.h File Reference
#include <wchar.h>
#include <gammu-types.h>
#include <gammu-config.h>
Include dependency graph for gammu-unicode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t UnicodeLength (const unsigned char *str)
 
char * DecodeUnicodeString (const unsigned char *src)
 
char * DecodeUnicodeConsole (const unsigned char *src)
 
void DecodeUnicode (const unsigned char *src, char *dest)
 
void EncodeUnicode (unsigned char *dest, const char *src, size_t len)
 
void ReadUnicodeFile (unsigned char *Dest, const unsigned char *Source)
 
void CopyUnicodeString (unsigned char *Dest, const unsigned char *Source)
 
gboolean EncodeUTF8QuotedPrintable (char *dest, const unsigned char *src)
 
void DecodeUTF8QuotedPrintable (unsigned char *dest, const char *src, size_t len)
 
int EncodeWithUTF8Alphabet (unsigned long src, unsigned char *ret)
 
int DecodeWithUTF8Alphabet (const unsigned char *src, wchar_t *dest, size_t len)
 
gboolean DecodeHexUnicode (unsigned char *dest, const char *src, size_t len)
 
void EncodeHexUnicode (char *dest, const unsigned char *src, size_t len)
 
gboolean mywstrncmp (unsigned const char *a, unsigned const char *b, int num)
 
unsigned char * mywstrstr (unsigned const char *haystack, unsigned const char *needle)
 
gboolean mywstrncasecmp (unsigned const char *a, unsigned const char *b, int num)
 
gboolean EncodeUTF8 (char *dest, const unsigned char *src)
 
void DecodeUTF8 (unsigned char *dest, const char *src, size_t len)
 
gboolean DecodeHexBin (unsigned char *dest, const unsigned char *src, size_t len)
 
int EncodeWithUnicodeAlphabet (const unsigned char *value, wchar_t *dest)
 
int DecodeWithUnicodeAlphabet (wchar_t value, unsigned char *dest)
 

Detailed Description

Author
Michal Čihař

Unicode manipulation functions.

Definition in file gammu-unicode.h.

Function Documentation

§ DecodeWithUnicodeAlphabet()

int DecodeWithUnicodeAlphabet ( wchar_t  value,
unsigned char *  dest 
)

Converts single character from wchar_t to unicode.

Definition at line 210 of file coding.c.

Referenced by DecodeUnicode(), and myiswspace().

211 {
212  int retval;
213 
214  switch (retval = wctomb(dest, src)) {
215  case -1:
216  *dest = '?';
217  return 1;
218  default:
219  return retval;
220  }
221 }

§ EncodeWithUnicodeAlphabet()

int EncodeWithUnicodeAlphabet ( const unsigned char *  value,
wchar_t dest 
)

Converts single character from unicode to wchar_t.

Definition at line 198 of file coding.c.

Referenced by DecodeUTF7(), DecodeUTF8(), DecodeUTF8QuotedPrintable(), and EncodeUnicode().

199 {
200  int retval;
201 
202  switch (retval = mbtowc(dest, src, MB_CUR_MAX)) {
203  case -1 :
204  case 0 : return 1;
205  default : return retval;
206  }
207 }