summaryrefslogtreecommitdiff
path: root/source3/lib/charcnv.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/charcnv.c')
-rw-r--r--source3/lib/charcnv.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 6be455c47b..a7dff4224b 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -107,13 +107,18 @@ char *unix2dos_format(char *str,BOOL overwrite)
char *dp;
if (!mapsinited) initmaps();
- if (overwrite) {
- for (p = str; *p; p++) *p = unix2dos[(unsigned char)*p];
- return str;
- } else {
- for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = unix2dos[(unsigned char)*p];
- *dp = 0;
- return cvtbuf;
+
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ return (*_unix_to_dos)(str, overwrite);
+ else {
+ if (overwrite) {
+ for (p = str; *p; p++) *p = unix2dos[(unsigned char)*p];
+ return str;
+ } else {
+ for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = unix2dos[(unsigned char)*p];
+ *dp = 0;
+ return cvtbuf;
+ }
}
}
@@ -126,13 +131,18 @@ char *dos2unix_format(char *str, BOOL overwrite)
char *dp;
if (!mapsinited) initmaps();
- if (overwrite) {
- for (p = str; *p; p++) *p = dos2unix[(unsigned char)*p];
- return str;
- } else {
- for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = dos2unix[(unsigned char)*p];
- *dp = 0;
- return cvtbuf;
+
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ return (*_dos_to_unix)(str, overwrite);
+ else {
+ if (overwrite) {
+ for (p = str; *p; p++) *p = dos2unix[(unsigned char)*p];
+ return str;
+ } else {
+ for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = dos2unix[(unsigned char)*p];
+ *dp = 0;
+ return cvtbuf;
+ }
}
}