JISEncodedString.st
author Claus Gittinger <cg@exept.de>
Sat, 27 Apr 1996 13:17:40 +0200
changeset 262 1d0e8b654573
parent 260 427397326fac
child 264 1e508408ecf5
permissions -rw-r--r--
commentary

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

TwoByteString subclass:#JISEncodedString
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Collections-Text'
!

!JISEncodedString class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    JISEncodedString represents 16bit strings encoded in JIS.
    You need jis-encoded fonts on your display workstation, 
    to display them (i.e. when switching to japanese ...).

    Most of you are probably not interrested in those ...

    [author:]
        Claus Gittinger

    [see also:]
        BIG5EncodedString GBEncodedString
        TwoByteString String CharacterArray
        StringCollection
"
!

examples
"
    JISEncodedString fromString:'hello world'

    'hello world' decodeFrom:#jis7

    <someStringWithJIS7Escapes> decodeFrom:#jis7
"
! !

!JISEncodedString class methodsFor:'initialization'!

initialize
    "initialize the class - private"

    self flags:(Behavior flagWords)

    "
     JISEncodedString initialize
    "

    "Created: 27.4.1996 / 13:12:02 / cg"
! !

!JISEncodedString class methodsFor:'code tables'!

romanJISDecoderTable
    "return a table to decode from roman ascii to 16 bit JIS."

    ^ #(
                  16r212a 16r2149 16r2174 16r2170 16r2173 16r2175 16r2147 
          16r214a 16r214b 16r2176 16r215c 16r2124 16r215d 16r2125 16r213f 
          16r2330 16r2331 16r2332 16r2333 16r2334 16r2335 16r2336 16r2337 
          16r2338 16r2339 16r2127 16r2128 16r2163 16r2161 16r2164 16r2129 
          16r2177 16r2341 16r2342 16r2343 16r2344 16r2345 16r2346 16r2347 
          16r2348 16r2349 16r234a 16r234b 16r234c 16r234d 16r234e 16r234f 
          16r2350 16r2351 16r2352 16r2353 16r2354 16r2355 16r2356 16r2357 
          16r2358 16r2359 16r235a 16r214e 16r2140 16r214f 16r2130 16r2132 
          16r2146 16r2361 16r2362 16r2363 16r2364 16r2365 16r2366 16r2367 
          16r2368 16r2369 16r236a 16r236b 16r236c 16r236d 16r236e 16r236f 
          16r2370 16r2371 16r2372 16r2373 16r2374 16r2375 16r2376 16r2377 
          16r2378 16r2379 16r237a 16r2150 16r2143 16r2151 16r2141 16r2121 
          16r2121 16r2123 16r2156 16r2157 16r2122 16r2126 16r2572 16r2521 
          16r2523 16r2525 16r2527 16r2529 16r2563 16r2565 16r2567 16r2543 
          16r213c 16r2522 16r2524 16r2526 16r2528 16r252a 16r252b 16r252d 
          16r252f 16r2531 16r2533 16r2535 16r2537 16r2539 16r253b 16r253d 
          16r253f 16r2541 16r2544 16r2546 16r2548 16r254a 16r254b 16r254c 
          16r254d 16r254e 16r254f 16r2552 16r2555 16r2558 16r255b 16r255e 
          16r255f 16r2560 16r2561 16r2562 16r2564 16r2566 16r2568 16r2569 
          16r256a 16r256b 16r256c 16r256d 16r256f 16r2573 16r212b 16r212c ).

    "Created: 26.2.1996 / 17:52:19 / cg"
    "Modified: 22.4.1996 / 16:09:12 / cg"
! !

!JISEncodedString class methodsFor:'standards'!

jis7KanjiEscapeSequence
    "return the escape sequence used to switch to kanji in jis7 encoded strings"

    ^ Character esc asString , '$B'.

    "Created: 26.2.1996 / 17:38:08 / cg"
    "Modified: 22.4.1996 / 16:08:35 / cg"
!

jis7RomanEscapeSequence
    "return the escape sequence used to switch to roman in jis7 encoded strings"

    ^ Character esc asString , '(J'.

    "Created: 26.2.1996 / 17:38:03 / cg"
    "Modified: 22.4.1996 / 16:08:42 / cg"
!

oldJis7KanjiEscapeSequence
    "return the escape sequence used to switch to kanji in 
     old jis7 encoded strings"

    ^ Character esc asString , '$@'.

    "Created: 26.2.1996 / 21:53:18 / cg"
    "Modified: 22.4.1996 / 16:08:53 / cg"
! !

!JISEncodedString methodsFor:'queries'!

encoding
    "return the strings encoding; Here, #jis is returned."

    ^ #jis

    "Modified: 22.4.1996 / 16:09:42 / cg"
! !

!JISEncodedString class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic2/JISEncodedString.st,v 1.10 1996-04-27 11:17:40 cg Exp $'
! !
JISEncodedString initialize!