summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/kpathsea/knj.c22
-rw-r--r--Build/source/texk/kpathsea/progname.c6
2 files changed, 24 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index a4fcd3a6d91..bdf7d5cbf75 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -22,11 +22,29 @@ int is_cp932_system;
int isknj(int c)
{
c &= 0xff;
- return((c>=0x81 && c<=0x9f) || (c>=0xe0 && c<=0xfc));
+ switch (is_cp932_system) {
+ case 932:
+ return((c>=0x81 && c<=0x9f) || (c>=0xe0 && c<=0xfc));
+ case 936:
+ return(c>=0x81 && c<=0xfe);
+ case 950:
+ return((c>=0xa1 && c<=0xc6) || (c>=0xc9 && c<=0xf9));
+ default:
+ return(0);
+ }
}
int isknj2(int c)
{
c &= 0xff;
- return(c>=0x40 && c<=0xfc && c!=0x7f);
+ switch (is_cp932_system) {
+ case 932:
+ return(c>=0x40 && c<=0xfc && c!=0x7f);
+ case 936:
+ return(c>=0x40 && c<=0xfe && c!=0x7f);
+ case 950:
+ return((c>=0x40 && c<=0x7e) || (c>=0xa1 && c<=0xfe));
+ default:
+ return(0);
+ }
}
diff --git a/Build/source/texk/kpathsea/progname.c b/Build/source/texk/kpathsea/progname.c
index dd65d5247d7..9e6a91b219d 100644
--- a/Build/source/texk/kpathsea/progname.c
+++ b/Build/source/texk/kpathsea/progname.c
@@ -501,8 +501,10 @@ kpathsea_set_program_name (kpathsea kpse, const_string argv0,
}
#if defined(WIN32)
- cp = GetACP();
- is_cp932_system = (cp == 932 || cp == 936 || cp == 950);
+ cp = GetOEMCP();
+ if (cp == 932 || cp == 936 || cp == 950) {
+ is_cp932_system = cp;
+ }
#if defined(__MINGW32__)
/* Set various info about user. Among many things,