summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2015-10-25 09:16:06 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2015-10-25 09:16:06 +0000
commita3456c69107a97f155fa0b80458580d3aced4175 (patch)
treec548a59ef94a5695f1ad65b8b3c392205f82bf43 /Build
parent0a0d8ed774009748ebc7b0a8840e00475fe05722 (diff)
texk/ptexenc: Enable composition of Hira-/Katakana in upTeX
git-svn-id: svn://tug.org/texlive/trunk@38704 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/ptexenc/ChangeLog6
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog
index c247b9d2485..d95467445d6 100644
--- a/Build/source/texk/ptexenc/ChangeLog
+++ b/Build/source/texk/ptexenc/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-25 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * ptexenc.c: Enable composition of Hiragana, Katakana
+ from combining character sequences to precomposed characters
+ in upTeX.
+
2015-06-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* version.ac: Update version number 1.3.3 => 1.3.4dev.
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index ddf2a8646ab..3fce9aaaa1b 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -616,16 +616,18 @@ static unsigned char *buffer;
static long first, last;
static boolean combin_voiced_sound(boolean semi)
{
- int i;
+ int i, mblen;
- if (last-2 < first) return false;
- if (multistrlen(buffer,last,last-2) != 2) return false;
- i = toUCS(fromBUFF(buffer,last,last-2));
+ mblen = is_internalUPTEX() ? 3 : 2;
+ if (last-mblen < first) return false;
+ if (multistrlen(buffer,last,last-mblen) != mblen) return false;
+ i = toUCS(fromBUFF(buffer,last,last-mblen));
i = get_voiced_sound(i, semi);
if (i == 0) return false;
i = toBUFF(fromUCS(i));
- buffer[last-2] = HI(i);
- buffer[last-1] = LO(i);
+ if (BYTE2(i) != 0) buffer[last-3] = BYTE2(i);
+ /* always */ buffer[last-2] = BYTE3(i);
+ /* always */ buffer[last-1] = BYTE4(i);
return true;
}