|
제가 유니코드를 utf7으로 바꾸는 라이브러리를 갖고 있는데요..
함수 관련된 사항은 아래와 같습니다.
근데 아무리 읽어 봐도 이해를 잘 못하겠어요.. (창피합니다)
아래의 설명을 보고 사용법을 아시는 분은 좀 설명해 주세요.
그리고 utf7이 결국 아스키 코드 맞는건가요? 이점도 가르쳐 주시면 감사하겠습니다.
결국 usc2를 넣으면 utf7 code가 나와야 하는데
start는 뭐고 end는 뭔지 그리고 첫번째 파라미터가 왜 더블포인터야 하는지 잘 이해가 안갑니다.
소스도 없이 이런 질문 올리는것 자체가 우스운 일이지만
이런 함수가 널리 쓰인다면 아시는 분이 있을거 같아서 질문 올립니다.
typedef unsigned short UCS2;
/* ================================================================ */
/* Each of these routines converts the text between *sourceStart and
sourceEnd, putting the result into the buffer between *targetStart and
targetEnd. Note: the end pointers are *after* the last item: e.g.
*(sourceEnd - 1) is the last item.
The return result indicates whether the conversion was successful,
and if not, whether the problem was in the source or target buffers.
After the conversion, *sourceStart and *targetStart are both
updated to point to the end of last text successfully converted in
the respective buffers.
In ConvertUCS2toUTF7, optional indicates whether UTF-7 optional
characters should be directly encoded, and verbose controls whether the
shift-out character, "-", is always emitted at the end of a shifted
sequence.
*/
typedef enum {
ok, /* conversion successful */
sourceCorrupt, /* source contains invalid UTF-7 */
targetExhausted /* insuff. room in target for conversion */
} ConversionResult;
ConversionResult ConvertUCS2toUTF7 (
UCS2** sourceStart, const UCS2* sourceEnd,
char** targetStart, const char* targetEnd,
int optional, int verbose);
ConversionResult ConvertUTF7toUCS2 (
char** sourceStart, char* sourceEnd,
UCS2** targetStart, const UCS2* targetEnd);
/* ================================================================ */
|