diff --git a/src/common/tgttrans.c b/src/common/tgttrans.c index ba4e3f5e0..022dafede 100644 --- a/src/common/tgttrans.c +++ b/src/common/tgttrans.c @@ -150,3 +150,23 @@ char* TgtTranslateStr (char* S) +char* TgtTranslateBuf (char* Buf, unsigned Len) +/* Translate a buffer of the given length from the source character set into + * the target system character set. + */ +{ + /* Translate */ + if (Tab) { + unsigned char* B = (unsigned char*)Buf; + while (Len--) { + *B = Tab[*B]; + ++B; + } + } + + /* Return the argument string */ + return Buf; +} + + + diff --git a/src/common/tgttrans.h b/src/common/tgttrans.h index fc5f8aeba..38bdefae8 100644 --- a/src/common/tgttrans.h +++ b/src/common/tgttrans.h @@ -57,6 +57,11 @@ char* TgtTranslateStr (char* S); * system character set. */ +char* TgtTranslateBuf (char* Buf, unsigned Len); +/* Translate a buffer of the given length from the source character set into + * the target system character set. + */ + /* End of tgttrans.h */