~ubuntu-branches/ubuntu/hoary/gsmlib/hoary

« back to all changes in this revision

Viewing changes to doc/FAQ

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2003-07-19 15:57:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20030719155728-bruh6cu1054ptjq9
Tags: 1.10-5
* Change Section: libdevel
* gsm_unix_serial.cc patch from Daniel Schepler to fix g++-3.3
  compliation. Thanks. (Closes: Bug#195151)

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
  ./configure --disable-shared --enable-static
77
77
 
78
78
if you encounter strange problems.
 
79
 
 
80
*** 9. How to support unicode? 
 
81
 
 
82
You need 6 steps:
 
83
 
 
84
1. set datacodingschema to DCS_SIXTEEN_BIT_ALPHABET
 
85
 
 
86
2. set your locale correctly, for example, my locale, china. 
 
87
    setlocale(LC_ALL, "chs");
 
88
 
 
89
3. translate MBCS(multiple byte character set) string to unicode string.
 
90
    wchar_t wstr[ 1000 ];
 
91
    memset(wstr, 0, 2000);
 
92
    mbstowcs(wstr, data.c_str(), data.length());
 
93
 
 
94
4. get unicode string length.
 
95
    int wcs_len = wcslen(wstr);
 
96
 
 
97
5. change unicode string to net order.
 
98
    for (int i = 0; i < wcs_len; i++)
 
99
        wstr[ i ] = htons(wstr[ i ]);
 
100
 
 
101
6. put unicode string into pdu.