1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00

Add a couple of functions, EUC->SJIS and SJIS->EUC conversion.

PR: ports/13154
Submitted by: knu@and.or.jp
This commit is contained in:
Seiichirou Hiraoka 1999-08-23 04:45:06 +00:00
parent d8567e3606
commit d395e65ed7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=20904

View File

@ -0,0 +1,42 @@
*** jlib.h 1999/07/11 15:47:33 1.1.1.1
--- jlib.h 1999/07/11 16:51:11 1.1.1.1.2.2
***************
*** 14,17 ****
--- 14,19 ----
extern char *toStringJIS(char *str);
extern char *toStringEUC(char *str);
extern char *toStringSJIS(char *str);
+ extern char *toStringEUCfromSJIS(char *str);
+ extern char *toStringSJISfromEUC(char *str);
*** libjcode.c 1999/07/11 15:47:33 1.1.1.1
--- libjcode.c 1999/07/11 16:51:11 1.1.1.1.2.3
***************
*** 494,499 ****
--- 494,520 ----
}
+ char *toStringEUCfromSJIS(char *str) {
+ unsigned char *buf;
+
+ buf = _set_buffer(str);
+
+ _shift2euc((unsigned char *)str, buf);
+
+ return (char *)_replace_buffer(buf);
+ }
+
+ char *toStringSJISfromEUC(char *str) {
+ unsigned char *buf;
+
+ buf = _set_buffer(str);
+
+ _euc2shift((unsigned char *)str, buf);
+
+ return _replace_buffer(buf);
+ }
+
+
char *test(char *str) {
static char buffer[BUFSIZ];