{- This file has been auto-generated. Do not edit it. -}
{-# LANGUAGE MagicHash,DeriveDataTypeable #-}
{- |

32	 =   (32)

33	 = ! (33)

34	 = " (34)

35	 = # (35)

36	 = $ (36)

37	 = % (37)

38	 = & (38)

39	 = ' (39)

40	 = ( (40)

41	 = ) (41)

42	 = * (42)

43	 = + (43)

44	 = , (44)

45	 = - (45)

46	 = . (46)

47	 = / (47)

48	 = 0 (48)

49	 = 1 (49)

50	 = 2 (50)

51	 = 3 (51)

52	 = 4 (52)

53	 = 5 (53)

54	 = 6 (54)

55	 = 7 (55)

56	 = 8 (56)

57	 = 9 (57)

58	 = : (58)

59	 = &#59; (59)

60	 = < (60)

61	 = = (61)

62	 = > (62)

63	 = ? (63)

64	 = @ (64)

65	 = A (65)

66	 = B (66)

67	 = C (67)

68	 = D (68)

69	 = E (69)

70	 = F (70)

71	 = G (71)

72	 = H (72)

73	 = I (73)

74	 = J (74)

75	 = K (75)

76	 = L (76)

77	 = M (77)

78	 = N (78)

79	 = O (79)

80	 = P (80)

81	 = Q (81)

82	 = R (82)

83	 = S (83)

84	 = T (84)

85	 = U (85)

86	 = V (86)

87	 = W (87)

88	 = X (88)

89	 = Y (89)

90	 = Z (90)

91	 = [ (91)

92	 = ¥ (165)

93	 = ] (93)

94	 = ^ (94)

95	 = _ (95)

96	 = ` (96)

97	 = a (97)

98	 = b (98)

99	 = c (99)

100	 = d (100)

101	 = e (101)

102	 = f (102)

103	 = g (103)

104	 = h (104)

105	 = i (105)

106	 = j (106)

107	 = k (107)

108	 = l (108)

109	 = m (109)

110	 = n (110)

111	 = o (111)

112	 = p (112)

113	 = q (113)

114	 = r (114)

115	 = s (115)

116	 = t (116)

117	 = u (117)

118	 = v (118)

119	 = w (119)

120	 = x (120)

121	 = y (121)

122	 = z (122)

123	 = { (123)

124	 = | (124)

125	 = } (125)

126	 = ‾ (8254)

161	 = 。 (65377)

162	 = 「 (65378)

163	 = 」 (65379)

164	 = 、 (65380)

165	 = ・ (65381)

166	 = ヲ (65382)

167	 = ァ (65383)

168	 = ィ (65384)

169	 = ゥ (65385)

170	 = ェ (65386)

171	 = ォ (65387)

172	 = ャ (65388)

173	 = ュ (65389)

174	 = ョ (65390)

175	 = ッ (65391)

176	 = ー (65392)

177	 = ア (65393)

178	 = イ (65394)

179	 = ウ (65395)

180	 = エ (65396)

181	 = オ (65397)

182	 = カ (65398)

183	 = キ (65399)

184	 = ク (65400)

185	 = ケ (65401)

186	 = コ (65402)

187	 = サ (65403)

188	 = シ (65404)

189	 = ス (65405)

190	 = セ (65406)

191	 = ソ (65407)

192	 = タ (65408)

193	 = チ (65409)

194	 = ツ (65410)

195	 = テ (65411)

196	 = ト (65412)

197	 = ナ (65413)

198	 = ニ (65414)

199	 = ヌ (65415)

200	 = ネ (65416)

201	 = ノ (65417)

202	 = ハ (65418)

203	 = ヒ (65419)

204	 = フ (65420)

205	 = ヘ (65421)

206	 = ホ (65422)

207	 = マ (65423)

208	 = ミ (65424)

209	 = ム (65425)

210	 = メ (65426)

211	 = モ (65427)

212	 = ヤ (65428)

213	 = ユ (65429)

214	 = ヨ (65430)

215	 = ラ (65431)

216	 = リ (65432)

217	 = ル (65433)

218	 = レ (65434)

219	 = ロ (65435)

220	 = ワ (65436)

221	 = ン (65437)

222	 = ゙ (65438)

223	 = ゚ (65439)
 -}
module Data.Encoding.JISX0201(JISX0201(..)) where

import Data.Encoding.Base
import Data.Encoding.ByteSource
import Data.Encoding.ByteSink
import Data.Encoding.Exception
import Data.CharMap
import Data.Array.Static
import Data.Map.Static
import Control.Throws
import Prelude hiding (lookup)
import Data.Word

import Data.Typeable

data JISX0201 = JISX0201
  deriving (Show,Eq,Typeable)

decoding_array_JISX0201 = StaticArray (32) (223) "\32\0\0\0\33\0\0\0\34\0\0\0\35\0\0\0\36\0\0\0\37\0\0\0\38\0\0\0\39\0\0\0\40\0\0\0\41\0\0\0\42\0\0\0\43\0\0\0\44\0\0\0\45\0\0\0\46\0\0\0\47\0\0\0\48\0\0\0\49\0\0\0\50\0\0\0\51\0\0\0\52\0\0\0\53\0\0\0\54\0\0\0\55\0\0\0\56\0\0\0\57\0\0\0\58\0\0\0\59\0\0\0\60\0\0\0\61\0\0\0\62\0\0\0\63\0\0\0\64\0\0\0\65\0\0\0\66\0\0\0\67\0\0\0\68\0\0\0\69\0\0\0\70\0\0\0\71\0\0\0\72\0\0\0\73\0\0\0\74\0\0\0\75\0\0\0\76\0\0\0\77\0\0\0\78\0\0\0\79\0\0\0\80\0\0\0\81\0\0\0\82\0\0\0\83\0\0\0\84\0\0\0\85\0\0\0\86\0\0\0\87\0\0\0\88\0\0\0\89\0\0\0\90\0\0\0\91\0\0\0\165\0\0\0\93\0\0\0\94\0\0\0\95\0\0\0\96\0\0\0\97\0\0\0\98\0\0\0\99\0\0\0\100\0\0\0\101\0\0\0\102\0\0\0\103\0\0\0\104\0\0\0\105\0\0\0\106\0\0\0\107\0\0\0\108\0\0\0\109\0\0\0\110\0\0\0\111\0\0\0\112\0\0\0\113\0\0\0\114\0\0\0\115\0\0\0\116\0\0\0\117\0\0\0\118\0\0\0\119\0\0\0\120\0\0\0\121\0\0\0\122\0\0\0\123\0\0\0\124\0\0\0\125\0\0\0\62\32\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\97\255\0\0\98\255\0\0\99\255\0\0\100\255\0\0\101\255\0\0\102\255\0\0\103\255\0\0\104\255\0\0\105\255\0\0\106\255\0\0\107\255\0\0\108\255\0\0\109\255\0\0\110\255\0\0\111\255\0\0\112\255\0\0\113\255\0\0\114\255\0\0\115\255\0\0\116\255\0\0\117\255\0\0\118\255\0\0\119\255\0\0\120\255\0\0\121\255\0\0\122\255\0\0\123\255\0\0\124\255\0\0\125\255\0\0\126\255\0\0\127\255\0\0\128\255\0\0\129\255\0\0\130\255\0\0\131\255\0\0\132\255\0\0\133\255\0\0\134\255\0\0\135\255\0\0\136\255\0\0\137\255\0\0\138\255\0\0\139\255\0\0\140\255\0\0\141\255\0\0\142\255\0\0\143\255\0\0\144\255\0\0\145\255\0\0\146\255\0\0\147\255\0\0\148\255\0\0\149\255\0\0\150\255\0\0\151\255\0\0\152\255\0\0\153\255\0\0\154\255\0\0\155\255\0\0\156\255\0\0\157\255\0\0\158\255\0\0\159\255\0\0"#

encoding_map_JISX0201 :: CharMap
encoding_map_JISX0201 = LeafMap1 (StaticMap (StaticArray (1) (158) "\62\32\0\0\95\0\0\0\128\255\0\0\63\0\0\0\111\0\0\0\112\255\0\0\144\255\0\0\47\0\0\0\79\0\0\0\103\0\0\0\119\0\0\0\104\255\0\0\120\255\0\0\136\255\0\0\152\255\0\0\39\0\0\0\55\0\0\0\71\0\0\0\87\0\0\0\99\0\0\0\107\0\0\0\115\0\0\0\123\0\0\0\100\255\0\0\108\255\0\0\116\255\0\0\124\255\0\0\132\255\0\0\140\255\0\0\148\255\0\0\156\255\0\0\35\0\0\0\43\0\0\0\51\0\0\0\59\0\0\0\67\0\0\0\75\0\0\0\83\0\0\0\91\0\0\0\97\0\0\0\101\0\0\0\105\0\0\0\109\0\0\0\113\0\0\0\117\0\0\0\121\0\0\0\125\0\0\0\98\255\0\0\102\255\0\0\106\255\0\0\110\255\0\0\114\255\0\0\118\255\0\0\122\255\0\0\126\255\0\0\130\255\0\0\134\255\0\0\138\255\0\0\142\255\0\0\146\255\0\0\150\255\0\0\154\255\0\0\158\255\0\0\33\0\0\0\37\0\0\0\41\0\0\0\45\0\0\0\49\0\0\0\53\0\0\0\57\0\0\0\61\0\0\0\65\0\0\0\69\0\0\0\73\0\0\0\77\0\0\0\81\0\0\0\85\0\0\0\89\0\0\0\94\0\0\0\96\0\0\0\98\0\0\0\100\0\0\0\102\0\0\0\104\0\0\0\106\0\0\0\108\0\0\0\110\0\0\0\112\0\0\0\114\0\0\0\116\0\0\0\118\0\0\0\120\0\0\0\122\0\0\0\124\0\0\0\165\0\0\0\97\255\0\0\99\255\0\0\101\255\0\0\103\255\0\0\105\255\0\0\107\255\0\0\109\255\0\0\111\255\0\0\113\255\0\0\115\255\0\0\117\255\0\0\119\255\0\0\121\255\0\0\123\255\0\0\125\255\0\0\127\255\0\0\129\255\0\0\131\255\0\0\133\255\0\0\135\255\0\0\137\255\0\0\139\255\0\0\141\255\0\0\143\255\0\0\145\255\0\0\147\255\0\0\149\255\0\0\151\255\0\0\153\255\0\0\155\255\0\0\157\255\0\0\159\255\0\0\32\0\0\0\34\0\0\0\36\0\0\0\38\0\0\0\40\0\0\0\42\0\0\0\44\0\0\0\46\0\0\0\48\0\0\0\50\0\0\0\52\0\0\0\54\0\0\0\56\0\0\0\58\0\0\0\60\0\0\0\62\0\0\0\64\0\0\0\66\0\0\0\68\0\0\0\70\0\0\0\72\0\0\0\74\0\0\0\76\0\0\0\78\0\0\0\80\0\0\0\82\0\0\0\84\0\0\0\86\0\0\0\88\0\0\0\90\0\0\0\93\0\0\0"#) (StaticArray (1) (158) "\126\95\192\63\111\176\208\47\79\103\119\168\184\200\216\39\55\71\87\99\107\115\123\164\172\180\188\196\204\212\220\35\43\51\59\67\75\83\91\97\101\105\109\113\117\121\125\162\166\170\174\178\182\186\190\194\198\202\206\210\214\218\222\33\37\41\45\49\53\57\61\65\69\73\77\81\85\89\94\96\98\100\102\104\106\108\110\112\114\116\118\120\122\124\92\161\163\165\167\169\171\173\175\177\179\181\183\185\187\189\191\193\195\197\199\201\203\205\207\209\211\213\215\217\219\221\223\32\34\36\38\40\42\44\46\48\50\52\54\56\58\60\62\64\66\68\70\72\74\76\78\80\82\84\86\88\90\93"#))

instance Encoding JISX0201 where
  decodeChar _ = do
    w <- fetchWord8
    (if w<32||w>223 then throwException $ IllegalCharacter $ fromIntegral w else return ())
    case decoding_array_JISX0201!w of
      Nothing -> throwException $ IllegalCharacter $ fromIntegral w
      Just c -> return c
  encodeChar _ c = mapEncode c encoding_map_JISX0201
  encodeable _ c = mapMember c encoding_map_JISX0201