4
* All rights reserved. Copyright (C) 1996 by NARITA Tomio.
5
* $Id: iso8859.c,v 1.3 2003/11/13 03:08:19 nrt Exp $
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
* one pre-designated 8bit charset uses G1.
36
public void EncodeISO8859( i_str_t *istr, int head, int tail,
37
byte codingSystem, boolean_t binary )
41
byte cset, csetG1 = ASCII;
43
csetG1 = cTable[ (int)codingSystem ].state.cset[ G1 ];
45
for( idx = head ; idx < tail ; idx++ ){
46
cset = istr[ idx ].charset;
48
attr = (int)istr[ idx ].attr << 8;
49
#ifndef MSDOS /* IF NOT DEFINED */
51
ic = UNItoISO8859( ic, &cset, codingSystem );
55
EncodeAddChar( attr, ic );
56
} else if( csetG1 == cset ){
57
EncodeAddChar( attr, 0x80 | ic );
59
if( FALSE == EncodeAddInvalid( attr, ic, cset ) )
62
} else if( FALSE == EncodeAddPseudo( attr, ic, cset, binary ) ){