diff -urN micq-0.4.0/Makefile micq-0.4.0.new/Makefile
--- micq-0.4.0/Makefile	Thu Feb 25 14:00:51 1999
+++ micq-0.4.0.new/Makefile	Sun May 16 03:45:53 1999
@@ -4,9 +4,10 @@
 CC = gcc
 CFLAGS = -O4 -Wall -DUNIX -DANSI_COLOR 
 CFLAGS += -DUSE_MREADLINE
-CFLAGS += -DENGLISH_LANG
+#CFLAGS += -DENGLISH_LANG
 #CFLAGS += -DBRAZIL_LANG
 #CFLAGS += -DRUSSIAN_LANG
+CFLAGS += -DJAPANESE_LANG
 # Uncomment the below line for humorous messages
 #CFLAGS += -DFUNNY_MSGS 
 # uncomment the line below for debuging info
@@ -20,9 +21,9 @@
 #CFLAGS += -posix
 OBJS =file_util.o icq_response.o micq.o msg_queue.o rus_conv.o sendmsg.o \
       server.o   \
-      ui.o util.o  util_ui.o mreadline.o
+      ui.o util.o  util_ui.o mreadline.o jconv.o
       
-HEADERS = datatype.h micq.h ui.h msg_queue.h mreadline.h
+HEADERS = datatype.h micq.h ui.h msg_queue.h mreadline.h jconv.h
 #
 all : micq
 
diff -urN micq-0.4.0/icq_response.c micq-0.4.0.new/icq_response.c
--- micq-0.4.0/icq_response.c	Thu Feb 25 14:00:51 1999
+++ micq-0.4.0.new/icq_response.c	Mon May 17 13:12:00 1999
@@ -3,6 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
+#include "jconv.h"
 #ifdef _WIN32
   #include <winsock2.h>
 #else
@@ -398,6 +399,8 @@
    char message[1024];
    char url_data[1024];
    char url_desc[1024];
+
+   data = toStringEUC(data);
 
    if ( type == USER_ADDED_MESS )
    {
diff -urN micq-0.4.0/japanese.h micq-0.4.0.new/japanese.h
--- micq-0.4.0/japanese.h	Thu Jan  1 09:00:00 1970
+++ micq-0.4.0.new/japanese.h	Mon May 17 00:57:44 1999
@@ -0,0 +1,283 @@
+/* Help categories*/
+#define CLIENT_CAT_STR "Client"
+#define MESSAGE_CAT_STR "Message"
+#define USER_CAT_STR "User"
+#define ACCOUNT_CAT_STR "Account"
+
+/* Help strings for each command */
+#define PASS_HELP_STR "\t\t¥Ñ¥¹¥ï¡¼¥ÉÊÑ¹¹\n"
+#define MSG_HELP_STR "\t\tuin ¤Ø¥á¥Ã¥»¡¼¥¸Á÷¿®\n"
+#define URL_HELP_STR "\tuin ¤Ë url ¤È¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®\n"
+#define MSGA_HELP_STR "\t\tÁ´°÷¤Ë¥á¥Ã¥»¡¼¥¸Á÷¿®\n"
+#define AGAIN_HELP_STR "\t\t\tºÇ¸å¤ËÁ÷¿®¤·¤¿¿Í¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®\n"
+#define AUTH_HELP_STR "\t\tuin ¤òÇ§¾Ú¥ê¥¹¥È¤ËÅÐÏ¿\n"
+#define REPLY_HELP_STR "\t\t\tºÇ¸å¤ËÁ÷¿®¤·¤Æ¤­¤¿¤Ò¤È¤Ø¥á¥Ã¥»¡¼¥¸¤òÊÖ¿®\n"
+#define RAND_HELP_STR "\t\t»ØÄê¤µ¤ì¤¿¥°¥ë¡¼¥×¤ÎÃæ¤«¤é¥é¥ó¥À¥à¤Ë¥æ¡¼¥¶¤ò¸¡º÷\n"
+#define LIST_HELP_STR "\t\t\tÁ´°÷¤Î¾õÂÖ¤òÉ½¼¨\n"
+#define ALTER_HELP_STR "\t¥³¥Þ¥ó¥É¤ÎÊÌÌ¾ÄêµÁ\n"
+#define VERBOSE_HELP_STR "\t\t\t¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤ÎÊÑ¹¹ (¥Ç¥Õ¥©¥ë¥È = 0)\n"
+#define CLEAR_HELP_STR "\t\t\t\tÃ¼Ëö¤Î¥¯¥ê¥¢\n"
+#define SOUND_HELP_STR "\t\t\t\t¿·Ãå¥á¥Ã¥»¡¼¥¸¤ÎºÝ¤Î¥Ó¡¼¥×ÀßÄê\n"
+#define COLOR_HELP_STR "\t\t\t\tÃ¼Ëö¤Î¥«¥é¡¼²½\n"
+#define QUIT_HELP_STR "\t\t\t¥í¥°¥ª¥Õ¤·¤Æ½ªÎ»\n"
+#define AUTO1_HELP_STR "\t\t\t\t¼«Æ°±þÅú¤Î¾õÂÖÉ½¼¨\n"
+#define AUTO2_HELP_STR "\t\t\t¼«Æ°±þÅú¤Î¾õÂÖÊÑ¹¹\n"
+#define AUTO3_HELP_STR "\t\t¼«Æ°±þÅú¥á¥Ã¥»¡¼¥¸¤ÎÊÑ¹¹\n"
+#define REG_HELP_STR "\t¿·¤·¤¤ uin ¤òºîÀ®\n"
+#define CHANGE_HELP_STR "\t¾õÂÖÈÖ¹æ¤ÎÊÑ¹¹\n\t\tÈÖ¹æ¤¬Ìµ¤¤¾ì¹ç¤Ï abailable ¥â¡¼¥É\n"
+#define ADD_HELP_STR "\tuin ¤ò¥ê¥¹¥È¤ËÄÉ²Ã\n"
+#define SEARCH_HELP_STR "\tÅÅ»Ò¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¸¡º÷\n"
+#define INFO_HELP_STR "\t\tuin ¤Î¸Ä¿Í¾ðÊó¤òÉ½¼¨\n"
+#define ONLINE_HELP_STR "\t\t¡Ö¥ª¥ó¥é¥¤¥ó¡× ¤ËÊÑ¹¹.\n"
+#define AWAY_HELP_STR "\t\t¡ÖÉÔºß(Away)¡× ¤ËÊÑ¹¹\n"
+#define NA_HELP_STR "\t\t¡Ö³°½ÐÃæ(N/A)¡× ¤ËÊÑ¹¹\n"
+#define OCC_HELP_STR "\t\t¡Ö¼ÙËâ¤·¤Ê¤¤¤Ç(Occupied)¡× ¤ËÊÑ¹¹\n"
+#define DND_HELP_STR "\t\t¡Ö¼ÙËâ¤·¤Ê¤¤¤Ç(DND)¡× ¤ËÊÑ¹¹\n"
+#define FFC_HELP_STR "\t\t¡Ö¥Á¥ã¥Ã¥È¤·¤¿¤¤!¡×¤ËÊÑ¹¹\n"
+#define INV_HELP_STR "\t\t¡ÖÉÔ²Ä»ë¡× ¤ËÊÑ¹¹\n"
+#define UPDATE_HELP_STR "\t\t¥×¥í¥Õ¥¡¥¤¥ë¤ÎÊÑ¹¹ (ÅÅ»Ò¥á¡¼¥ë¥¢¥É¥ì¥¹, ¥Ë¥Ã¥¯¥Í¡¼¥à ¤Ê¤É)\n"
+#define SET_RAND_HELP_STR "\t\t¥é¥ó¥À¥à¥æ¡¼¥¶¥°¥ë¡¼¥×¤ÎÀßÄê\n"
+
+#define VERBOSE_LEVEL_STR  "¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë %d\n"
+#define NICK_NOT_FOUND_STR "%s ¤ÏÇ§¾Ú¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ë¥Ã¥¯¥Í¡¼¥à¤Ç¤¹"
+
+/* Used in the "w" user display */
+#define W_ONLINE_SINCE_STR " ¥ª¥ó¥é¥¤¥ó³«»Ï»þ %s"
+#define W_LAST_ONLINE_STR  " ºÇ½ª¥ª¥ó¥é¥¤¥ó»þ %s"
+#define W_LAST_ON_UNKNOWN_STR " "
+#define W_STATUS_STR "¤¢¤Ê¤¿¤Î¾õÂÖ: "
+#define W_OFFLINE_STR "¥ª¥Õ¥é¥¤¥ó¥æ¡¼¥¶: "
+#define W_ONLINE_STR "¥ª¥ó¥é¥¤¥ó¥æ¡¼¥¶: "
+
+#define MSG_PROMPT_STR "¥á¥Ã¥»¡¼¥¸> "
+#define MSGA_PROMPT_STR "Á´°÷¤Ø¥á¥Ã¥»¡¼¥¸> "
+
+/* These are used durring user info updates. */
+#define NICK_NAME_UPDATE_STR "¿·¤·¤¤ ¥Ë¥Ã¥¯¥Í¡¼¥à : "
+#define FIRST_NAME_UPDATE_STR "¥Õ¥¡¡¼¥¹¥È¥Í¡¼¥à : "
+#define LAST_NAME_UPDATE_STR "¥é¥¹¥È¥Í¡¼¥à : "
+#define EMAIL_UPDATE_STR "ÅÅ»Ò¥á¡¼¥ë¥¢¥É¥ì¥¹ : "
+#define AUTH_QUESTION_STR "Ç§¾Ú¤òÉ¬Í×¤È¤·¤Þ¤¹¤«? : "
+
+#define YESNO_RESPONSE_STR " " YES_STR " ¤Þ¤¿¤Ï " NO_STR " ¤Ç¤³¤¿¤¨¤Æ¤¯¤À¤µ¤¤\n"
+#define MESSAGE_BUFFER_FULL_STR "¥á¥Ã¥»¡¼¥¸¤Î¥µ¥¤¥º¤¬Âç¤­¤¹¤®¤Þ¤¹\n"
+#define MESSAGE_CANCELED_STR "¥á¥Ã¥»¡¼¥¸¤Ï¥­¥ã¥ó¥»¥ë¤µ¤ì¤Þ¤·¤¿\n"
+/* Having 2 strings with the nickname inserted in the middle */
+/* will hopefully solve any potential word order problems */
+#define MESSAGE_SENT_1_STR  " "
+#define MESSAGE_SENT_2_STR  " ¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤Þ¤·¤¿\n"
+
+/********************************************************************/
+/* Simple Yes no response*/
+#define YES_STR "YES"
+#define NO_STR "NO"
+
+/* The promt used by Micq */
+#define PROMPT_STR SERVCOL "Micq> " NOCOL
+
+/* The different status modes */
+#define STATUS_ONLINE_STR "¥ª¥ó¥é¥¤¥ó"
+#define STATUS_DND_STR "¼ÙËâ¤·¤Ê¤¤¤Ç(DND)"
+#define STATUS_AWAY_STR "ÉÔºß(Away)"
+#define STATUS_NA_STR "³°½ÐÃæ(N/A)"
+#define STATUS_OCCUPIED_STR "¼è¤ê¹þ¤ßÃæ(Occupied)"
+#define STATUS_INVISIBLE_STR "ÉÔ²Ä»ë"
+#define STATUS_FFC_STR "¥Á¥ã¥Ã¥È¤·¤¿¤¤!"
+
+/* results of searches */
+#define ALL_FOUND_STR "Á´¥æ¡¼¥¶¸¡º÷´°Î»"
+#define TOO_MANY_STR "¤¿¤¯¤µ¤ó¤Î¥æ¡¼¥¶¤¬¸«¤Ä¤«¤ê¤Þ¤·¤¿"
+#define SEARCH_DONE_STR "¸¡º÷½ªÎ»"
+
+/* Strings for help screen */
+#define SELECT_GROUP_STR "¥Ø¥ë¥×¤Î¥È¥Ô¥Ã¥¯¤ò¼¡¤«¤éÁª¤ó¤Ç¤¯¤À¤µ¤¤"
+#define CLIENT_HELP_STR "micq ¤ÎÀßÄê¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É"
+#define USER_HELP_STR "ÊÌ¥æ¡¼¥¶¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É"
+#define ACCOUNT_HELP_STR "¤¢¤Ê¤¿¤Î ICQ ¥¢¥«¥¦¥ó¥È¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É"
+#define MESSAGE_HELP_STR "¥á¥Ã¥»¡¼¥¸Á÷¿®¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É"
+
+/* Various Strings */
+#define LENGTH_STR "Length"
+#define EXTRA_DATA_STR "Extra Data"
+#define SEQ_STR "SEQ"
+#define VER_STR "Ver"
+#define LOGIN_SUCCESS_STR "¥í¥°¥¤¥ó´°Î»!"
+#define SERVER_ACK_STR "The server acknowledged the %04x command."
+
+/* The Countries there's alot */
+#define USA_COUNTRY_STR "USA"
+#define Afghanistan_COUNTRY_STR (const char*) "Afghanistan"
+#define Albania_COUNTRY_STR "Albania"
+#define Algeria_COUNTRY_STR "Algeria"
+#define American_Samoa_COUNTRY_STR "American Samoa"
+#define Andorra_COUNTRY_STR "Andorra"
+#define Angola_COUNTRY_STR "Angola"
+#define Anguilla_COUNTRY_STR "Anguilla"
+#define Antigua_COUNTRY_STR "Antigua"
+#define Argentina_COUNTRY_STR "Argentina"
+#define Armenia_COUNTRY_STR "Armenia"
+#define Aruba_COUNTRY_STR "Aruba"
+#define Ascention_Island_COUNTRY_STR "Ascention Island"
+#define Australia_COUNTRY_STR "Australia"
+#define Australian_Antartic_Territory_COUNTRY_STR "Australian Antartic Territory"
+#define Austria_COUNTRY_STR "Austria"
+#define Azerbaijan_COUNTRY_STR "Azerbaijan"
+#define Bahamas_COUNTRY_STR "Bahamas"
+#define Bahrain_COUNTRY_STR "Bahrain"
+#define Bangladesh_COUNTRY_STR "Bangladesh"
+#define Barbados_COUNTRY_STR "Barbados"
+#define Belarus_COUNTRY_STR "Belarus"
+#define Belgium_COUNTRY_STR "Belgium"
+#define Belize_COUNTRY_STR "Belize"
+#define Benin_COUNTRY_STR "Benin"
+#define Bermuda_COUNTRY_STR "Bermuda"
+#define Bhutan_COUNTRY_STR "Bhutan"
+#define Bolivia_COUNTRY_STR "Bolivia"
+#define Bosnia_Herzegovina_COUNTRY_STR "Bosnia & Herzegovina"
+#define Botswana_COUNTRY_STR "Botswana"
+#define Brazil_COUNTRY_STR "Brazil"
+#define British_Virgin_Islands_COUNTRY_STR "British Virgin Islands"
+#define Brunei_COUNTRY_STR "Brunei"
+#define Bulgaria_COUNTRY_STR "Bulgaria"
+#define Burkina_Faso_COUNTRY_STR "Burkina Faso"
+#define Burundi_COUNTRY_STR "Burundi"
+#define Cambodia_COUNTRY_STR "Cambodia"
+#define Cameroon_COUNTRY_STR "Cameroon"
+#define Canada_COUNTRY_STR "Canada"
+#define Cape_Verde_Islands_COUNTRY_STR "Cape Verde Islands"
+#define Cayman_Islands_COUNTRY_STR "Cayman Islands"
+#define Central_African_Republic_COUNTRY_STR "Central African Republic"
+#define Chad_COUNTRY_STR "Chad"
+#define Christmas_Island_COUNTRY_STR "Christmas Island"
+#define Cocos_Keeling_Islands_COUNTRY_STR "Cocos-Keeling Islands"
+#define Comoros_COUNTRY_STR "Comoros"
+#define Congo_COUNTRY_STR "Congo"
+#define Cook_Islands_COUNTRY_STR "Cook Islands"
+#define Chile_COUNTRY_STR "Chile"
+#define China_COUNTRY_STR "China"
+#define Columbia_COUNTRY_STR "Columbia"
+#define Costa_Rice_COUNTRY_STR "Costa Rice"
+#define Croatia_COUNTRY_STR "Croatia"
+#define Cuba_COUNTRY_STR "Cuba"
+#define Cyprus_COUNTRY_STR "Cyprus"
+#define Czech_Republic_COUNTRY_STR "Czech Republic"
+#define Denmark_COUNTRY_STR "Denmark"
+#define Diego_Garcia_COUNTRY_STR "Diego Garcia"
+#define Djibouti_COUNTRY_STR "Djibouti"
+#define Dominica_COUNTRY_STR "Dominica"
+#define Dominican_Republic_COUNTRY_STR "Dominican Republic"
+#define Ecuador_COUNTRY_STR "Ecuador"
+#define Egypt_COUNTRY_STR "Egypt"
+#define El_Salvador_COUNTRY_STR "El Salvador"
+#define Equitorial_Guinea_COUNTRY_STR "Equitorial Guinea"
+#define Eritrea_COUNTRY_STR "Eritrea"
+#define Estonia_COUNTRY_STR "Estonia"
+#define Ethiopia_COUNTRY_STR "Ethiopia"
+#define Former_Yugoslavia_COUNTRY_STR "F.Y.R.O.M. (Former Yugoslavia)"
+#define Faeroe_Islands_COUNTRY_STR "Faeroe Islands"
+#define Falkland_Islands_COUNTRY_STR "Falkland Islands"
+#define Federated_States_of_Micronesia_COUNTRY_STR "Federated States of Micronesia"
+#define Fiji_COUNTRY_STR "Fiji"
+#define Finland_COUNTRY_STR "Finland"
+#define France_COUNTRY_STR "France"
+#define French_Antilles_COUNTRY_STR "French Antilles"
+#define French_Guiana_COUNTRY_STR "French Guiana"
+#define French_Polynesia_COUNTRY_STR "French Polynesia"
+#define Gabon_COUNTRY_STR "Gabon"
+#define Gambia_COUNTRY_STR "Gambia"
+#define Georgia_COUNTRY_STR "Georgia"
+#define Germany_COUNTRY_STR "Germany"
+#define Ghana_COUNTRY_STR "Ghana"
+#define Gibraltar_COUNTRY_STR "Gibraltar"
+#define Greece_COUNTRY_STR "Greece"
+#define Greenland_COUNTRY_STR "Greenland"
+#define Grenada_COUNTRY_STR "Grenada"
+#define Guadeloupe_COUNTRY_STR "Guadeloupe"
+#define Guam_COUNTRY_STR "Guam"
+#define Guantanomo_Bay_COUNTRY_STR "Guantanomo Bay"
+#define Guatemala_COUNTRY_STR "Guatemala"
+#define Guinea_COUNTRY_STR "Guinea"
+#define Guinea_Bissau_COUNTRY_STR "Guinea-Bissau"
+#define Guyana_COUNTRY_STR "Guyana"
+#define Haiti_COUNTRY_STR "Haiti"
+#define Honduras_COUNTRY_STR "Honduras"
+#define Hong_Kong_COUNTRY_STR "Hong Kong"
+#define Hungary_COUNTRY_STR "Hungary"
+#define Iceland_COUNTRY_STR "Iceland"
+#define India_COUNTRY_STR "India"
+#define Indonesia_COUNTRY_STR "Indonesia"
+#define INMARSAT_COUNTRY_STR "INMARSAT"
+#define INMARSAT_Atlantic_East_COUNTRY_STR "INMARSAT Atlantic-East"
+#define Iran_COUNTRY_STR "Iran"
+#define Iraq_COUNTRY_STR "Iraq"
+#define Ireland_COUNTRY_STR "Ireland"
+#define Israel_COUNTRY_STR "Israel"
+#define Italy_COUNTRY_STR "Italy"
+#define Ivory_Coast_COUNTRY_STR "Ivory Coast"
+#define Japan_COUNTRY_STR "Japan"
+#define Jordan_COUNTRY_STR "Jordan"
+#define Kenya_COUNTRY_STR "Kenya"
+#define South_Korea_COUNTRY_STR "South Korea"
+#define Kuwait_COUNTRY_STR "Kuwait"
+#define Liberia_COUNTRY_STR "Liberia"
+#define Libya_COUNTRY_STR "Libya"
+#define Liechtenstein_COUNTRY_STR "Liechtenstein"
+#define Luxembourg_COUNTRY_STR "Luxembourg"
+#define Malawi_COUNTRY_STR "Malawi"
+#define Malaysia_COUNTRY_STR "Malaysia"
+#define Mali_COUNTRY_STR "Mali"
+#define Malta_COUNTRY_STR "Malta"
+#define Mexico_COUNTRY_STR "Mexico"
+#define Monaco_COUNTRY_STR "Monaco"
+#define Morocco_COUNTRY_STR "Morocco"
+#define Namibia_COUNTRY_STR "Namibia"
+#define Nepal_COUNTRY_STR "Nepal"
+#define Netherlands_COUNTRY_STR "Netherlands"
+#define Netherlands_Antilles_COUNTRY_STR "Netherlands Antilles"
+#define New_Caledonia_COUNTRY_STR "New Caledonia"
+#define New_Zealand_COUNTRY_STR "New Zealand"
+#define Nicaragua_COUNTRY_STR "Nicaragua"
+#define Nigeria_COUNTRY_STR "Nigeria"
+#define Norway_COUNTRY_STR "Norway"
+#define Oman_COUNTRY_STR "Oman"
+#define Pakistan_COUNTRY_STR "Pakistan"
+#define Panama_COUNTRY_STR "Panama"
+#define Papua_New_Guinea_COUNTRY_STR "Papua New Guinea"
+#define Paraguay_COUNTRY_STR "Paraguay"
+#define Peru_COUNTRY_STR "Peru"
+#define Philippines_COUNTRY_STR "Philippines"
+#define Poland_COUNTRY_STR "Poland"
+#define Portugal_COUNTRY_STR "Portugal"
+#define Qatar_COUNTRY_STR "Qatar"
+#define Romania_COUNTRY_STR "Romania"
+#define Russia_COUNTRY_STR "Russia"
+#define Saipan_COUNTRY_STR "Saipan"
+#define San_Marino_COUNTRY_STR "San Marino"
+#define Saudia_Arabia_COUNTRY_STR "Saudia Arabia"
+#define Senegal_COUNTRY_STR "Senegal"
+#define Singapore_COUNTRY_STR "Singapore"
+#define Slovakia_COUNTRY_STR "Slovakia"
+#define South_Africa_COUNTRY_STR "South Africa"
+#define Spain_COUNTRY_STR "Spain"
+#define Sri_Lanka_COUNTRY_STR "Sri Lanka"
+#define Suriname_COUNTRY_STR "Suriname"
+#define Sweden_COUNTRY_STR "Sweden"
+#define Switzerland_COUNTRY_STR "Switzerland"
+#define Taiwan_COUNTRY_STR "Taiwan"
+#define Tanzania_COUNTRY_STR "Tanzania"
+#define Thailand_COUNTRY_STR "Thailand"
+#define Tunisia_COUNTRY_STR "Tunisia"
+#define Turkey_COUNTRY_STR "Turkey"
+#define United_Arab_Emirates_COUNTRY_STR "United Arab Emirates"
+#define Uruguay_COUNTRY_STR "Uruguay"
+#define UK_COUNTRY_STR "UK"
+#define Ukraine_COUNTRY_STR "Ukraine"
+#define Vatican_City_COUNTRY_STR "Vatican City"
+#define Venezuela_COUNTRY_STR "Venezuela"
+#define Vietnam_COUNTRY_STR "Vietnam"
+#define Yemen_COUNTRY_STR "Yemen"
+#define Yugoslavia_COUNTRY_STR "Yugoslavia"
+#define Zaire_COUNTRY_STR "Zaire"
+#define Zimbabwe_COUNTRY_STR "Zimbabwe"
+#define NON_COUNTRY_FUNNY_STR "Illegal alien"
+#define NON_COUNTRY_STR "Not entered"
diff -urN micq-0.4.0/jconv.c micq-0.4.0.new/jconv.c
--- micq-0.4.0/jconv.c	Thu Jan  1 09:00:00 1970
+++ micq-0.4.0.new/jconv.c	Mon May 17 12:44:37 1999
@@ -0,0 +1,203 @@
+/* 
+ *  jconv.c
+ */
+ 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "jconv.h"
+
+#define ESC           6
+#define LF            10
+#define CR            13
+
+#define CHAROUT(ch) *str2 = (unsigned char)(ch); str2++;
+#define HANKATA(a)  (a >= 161 && a <= 223)
+#define ISMARU(a)   (a >= 202 && a <= 206)
+#define ISNIGORI(a) ((a >= 182 && a <= 196) || (a >= 202 && a <= 206) || (a == 179))
+#define SJIS1(A)    ((A >= 129 && A <= 159) || (A >= 224 && A <= 239))
+#define SJIS2(A)    (A >= 64 && A <= 252)
+#define ISEUC(A)    (A >= 161 && A <= 254)
+#define ISLF(A)     (A == LF)
+#define ISCR(A)     (A == CR)
+
+static int stable[][2] = {
+    {129,66},{129,117},{129,118},{129,65},{129,69},{131,146},{131,64},
+    {131,66},{131,68},{131,70},{131,72},{131,131},{131,133},{131,135},
+    {131,98},{129,91},{131,65},{131,67},{131,69},{131,71},{131,73},
+    {131,74},{131,76},{131,78},{131,80},{131,82},{131,84},{131,86},
+    {131,88},{131,90},{131,92},{131,94},{131,96},{131,99},{131,101},
+    {131,103},{131,105},{131,106},{131,107},{131,108},{131,109},
+    {131,110},{131,113},{131,116},{131,119},{131,122},{131,125},
+    {131,126},{131,128},{131,129},{131,130},{131,132},{131,134},
+    {131,136},{131,137},{131,138},{131,139},{131,140},{131,141},
+    {131,143},{131,147},{129,74},{129,75}};
+
+unsigned char *_to_jis(unsigned char *str) 
+{
+  *str = (unsigned char)ESC; str++;
+  *str = (unsigned char)'$'; str++;
+  *str = (unsigned char)'B'; str++;
+  return str;
+}
+
+void _jis_shift(int *p1, int *p2)
+{
+  unsigned char c1 = *p1;
+  unsigned char c2 = *p2;
+  int rowOffset = c1 < 95 ? 112 : 176;
+  int cellOffset = c1 % 2 ? (c2 > 95 ? 32 : 31) : 126;
+
+  *p1 = ((c1 + 1) >> 1) + rowOffset;
+  *p2 += cellOffset;
+}
+
+void _sjis_shift(int *p1, int *p2)
+{
+  unsigned char c1 = *p1;
+  unsigned char c2 = *p2;
+  int adjust = c2 < 159;
+  int rowOffset = c1 < 160 ? 112 : 176;
+  int cellOffset = adjust ? (c2 > 127 ? 32 : 31) : 126;
+
+  *p1 = ((c1 - rowOffset) << 1) - adjust;
+  *p2 -= cellOffset;
+}
+
+unsigned char *_sjis_han2zen(unsigned char *str, int *p1, int *p2)
+{
+  register int c1, c2;
+
+  c1 = (int)*str; str++;
+  *p1 = stable[c1 - 161][0];
+  *p2 = stable[c1 - 161][1];
+
+  c2 = (int)*str;
+  if (c2 == 222 && ISNIGORI(c1)) {
+    if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122))
+      (*p2)++;
+    else if (*p1 == 131 && *p2 == 69)
+      *p2 = 148;
+    str++;
+  }
+
+  if (c2 == 223 && ISMARU(c1) && (*p2 >= 110 && *p2 <= 122) ) {
+    *p2 += 2;
+    str++;
+  }
+  return str++;
+}
+
+void _shift2euc(unsigned char *str, unsigned char *str2)
+{
+  int p1,p2;
+  
+  while ((p1 = (int)*str) != '\0') {
+    if (SJIS1(p1)) {
+      if((p2 = (int)*(++str)) == '\0') break;
+      if (SJIS2(p2)) {
+        _sjis_shift(&p1,&p2);
+        p1 += 128;
+        p2 += 128;
+      }
+      CHAROUT(p1);
+      CHAROUT(p2);
+      str++;
+      continue;
+    }
+
+#ifdef NO_HANKAKU_SJIS
+    if (HANKATA(p1)) {
+      str = _sjis_han2zen(str,&p1,&p2);
+      _sjis_shift(&p1,&p2);
+      p1 += 128;
+      p2 += 128;
+      CHAROUT(p1);
+      CHAROUT(p2);
+      continue;
+    }
+#endif
+
+#ifdef CONV_RETURN_CODE
+    if (ISCR(p1)) {
+      str++;
+      continue;
+    } 
+#endif
+
+    CHAROUT(p1);
+    str++;
+  }
+  *str2='\0';
+}
+
+void _euc2shift(unsigned char *str, unsigned char *str2)
+{
+  int p1,p2;
+
+  while ((p1 = (int)*str) != '\0') {
+    if (ISEUC(p1)) {
+      if((p2 = (int)*(++str)) == '\0') break;
+      if (ISEUC(p2)) {
+	p1 -= 128;
+        p2 -= 128;
+        _jis_shift(&p1,&p2);
+      }
+      CHAROUT(p1);
+      CHAROUT(p2);
+      str++;
+      continue;
+    }
+
+#ifdef CONV_RETURN_CODE
+    if (ISLF(p1)) {
+      CHAROUT(CR);
+      CHAROUT(LF);
+      str++;
+      continue;
+    }
+#endif
+
+    CHAROUT(p1);
+    str++;
+  }
+  *str2='\0';
+}
+
+unsigned char *_set_buffer(char *str) 
+{
+  static unsigned char *buf;
+  if((buf = (unsigned char *)malloc((strlen(str) + 1) * 4)) == NULL) {
+    fprintf(stderr, "Can't malloc buffer\n");
+    exit(2);
+  }
+  return buf;
+}
+
+char *_replace_buffer(unsigned char *buf) 
+{
+  char *str;
+
+  if ((str = strdup(buf)) == NULL) {
+    fprintf(stderr, "Can't malloc string buffer\n");
+    exit(2);
+  }
+  free(buf);
+  return str;
+}
+
+char *toStringEUC(char *str) 
+{
+  unsigned char *buf;
+  buf = _set_buffer(str);
+  _shift2euc((unsigned char *)str, buf);
+  return (char *)_replace_buffer(buf);
+}
+
+char *toStringSJIS(char *str) 
+{
+  unsigned char *buf;
+  buf = _set_buffer(str);
+  _euc2shift((unsigned char *)str, buf);
+  return _replace_buffer(buf);
+}
diff -urN micq-0.4.0/jconv.h micq-0.4.0.new/jconv.h
--- micq-0.4.0/jconv.h	Thu Jan  1 09:00:00 1970
+++ micq-0.4.0.new/jconv.h	Mon May 17 12:06:34 1999
@@ -0,0 +1,9 @@
+/*
+ * jconv.h
+ */
+
+#define CONV_RETURN_CODE
+#define NO_HANKAKU_SJIS
+
+extern char *toStringEUC(char *str);
+extern char *toStringSJIS(char *str);
diff -urN micq-0.4.0/lang.h micq-0.4.0.new/lang.h
--- micq-0.4.0/lang.h	Thu Feb 25 14:00:51 1999
+++ micq-0.4.0.new/lang.h	Sun May 16 03:45:14 1999
@@ -4,6 +4,8 @@
 #include "english.h"
 #elif defined BRAZIL_LANG
 #include "brazil.h"
+#elif defined JAPANESE_LANG
+#include "japanese.h"
 #else
 #error "Must select a language."
 #endif
Binary files micq-0.4.0/micq and micq-0.4.0.new/micq differ
diff -urN micq-0.4.0/sendmsg.c micq-0.4.0.new/sendmsg.c
--- micq-0.4.0/sendmsg.c	Thu Feb 25 14:00:51 1999
+++ micq-0.4.0.new/sendmsg.c	Mon May 17 12:23:01 1999
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <time.h>
+#include "jconv.h"
 #ifdef _WIN32
   #include <winsock2.h>
 #else
@@ -382,6 +383,9 @@
            log_event( LOG_MESS, "You sent instant message to %s\n%s\n", UIN2nick( uin ), text );
 	else
            log_event( LOG_MESS, "You sent instant message to %d\n%s\n", uin, text );
+   
+   	/* Convert EUC message to SJIS */
+	text = toStringSJIS(text);
 
 	rus_conv ("kw",text);
 	
