nkf 0.2.0-java → 0.3.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/sig/nkf.rbs ADDED
@@ -0,0 +1,404 @@
1
+ # <!-- rdoc-file=ext/nkf/nkf.c -->
2
+ # NKF - Ruby extension for Network Kanji Filter
3
+ #
4
+ # ## Description
5
+ #
6
+ # This is a Ruby Extension version of nkf (Network Kanji Filter). It converts
7
+ # the first argument and returns converted result. Conversion details are
8
+ # specified by flags as the first argument.
9
+ #
10
+ # **Nkf** is a yet another kanji code converter among networks, hosts and
11
+ # terminals. It converts input kanji code to designated kanji code such as
12
+ # ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 or UTF-16.
13
+ #
14
+ # One of the most unique faculty of **nkf** is the guess of the input kanji
15
+ # encodings. It currently recognizes ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 and
16
+ # UTF-16. So users needn't set the input kanji code explicitly.
17
+ #
18
+ # By default, X0201 kana is converted into X0208 kana. For X0201 kana, SO/SI,
19
+ # SSO and ESC-(-I methods are supported. For automatic code detection, nkf
20
+ # assumes no X0201 kana in Shift_JIS. To accept X0201 in Shift_JIS, use **-X**,
21
+ # **-x** or **-S**.
22
+ #
23
+ # ## Flags
24
+ #
25
+ # ### -b -u
26
+ #
27
+ # Output is buffered (DEFAULT), Output is unbuffered.
28
+ #
29
+ # ### -j -s -e -w -w16 -w32
30
+ #
31
+ # Output code is ISO-2022-JP (7bit JIS), Shift_JIS, EUC-JP, UTF-8N, UTF-16BE,
32
+ # UTF-32BE. Without this option and compile option, ISO-2022-JP is assumed.
33
+ #
34
+ # ### -J -S -E -W -W16 -W32
35
+ #
36
+ # Input assumption is JIS 7 bit, Shift_JIS, EUC-JP, UTF-8, UTF-16, UTF-32.
37
+ #
38
+ # #### -J
39
+ #
40
+ # Assume JIS input. It also accepts EUC-JP. This is the default. This flag does
41
+ # not exclude Shift_JIS.
42
+ #
43
+ # #### -S
44
+ #
45
+ # Assume Shift_JIS and X0201 kana input. It also accepts JIS. EUC-JP is
46
+ # recognized as X0201 kana. Without **-x** flag, X0201 kana (halfwidth kana) is
47
+ # converted into X0208.
48
+ #
49
+ # #### -E
50
+ #
51
+ # Assume EUC-JP input. It also accepts JIS. Same as -J.
52
+ #
53
+ # ### -t
54
+ #
55
+ # No conversion.
56
+ #
57
+ # ### -i_
58
+ #
59
+ # Output sequence to designate JIS-kanji. (DEFAULT B)
60
+ #
61
+ # ### -o_
62
+ #
63
+ # Output sequence to designate ASCII. (DEFAULT B)
64
+ #
65
+ # ### -r
66
+ #
67
+ # {de/en}crypt ROT13/47
68
+ #
69
+ # ### -h[123] --hiragana --katakana --katakana-hiragana
70
+ #
71
+ # -h1 --hiragana
72
+ # : Katakana to Hiragana conversion.
73
+ #
74
+ #
75
+ # -h2 --katakana
76
+ # : Hiragana to Katakana conversion.
77
+ #
78
+ #
79
+ # -h3 --katakana-hiragana
80
+ # : Katakana to Hiragana and Hiragana to Katakana conversion.
81
+ #
82
+ #
83
+ # ### -T
84
+ #
85
+ # Text mode output (MS-DOS)
86
+ #
87
+ # ### -l
88
+ #
89
+ # ISO8859-1 (Latin-1) support
90
+ #
91
+ # ### -f[`m` [- `n`]]
92
+ #
93
+ # Folding on `m` length with `n` margin in a line. Without this option, fold
94
+ # length is 60 and fold margin is 10.
95
+ #
96
+ # ### -F
97
+ #
98
+ # New line preserving line folding.
99
+ #
100
+ # ### -Z[0-3]
101
+ #
102
+ # Convert X0208 alphabet (Fullwidth Alphabets) to ASCII.
103
+ #
104
+ # -Z -Z0
105
+ # : Convert X0208 alphabet to ASCII.
106
+ #
107
+ #
108
+ # -Z1
109
+ # : Converts X0208 kankaku to single ASCII space.
110
+ #
111
+ #
112
+ # -Z2
113
+ # : Converts X0208 kankaku to double ASCII spaces.
114
+ #
115
+ #
116
+ # -Z3
117
+ # : Replacing Fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as
118
+ # in HTML.
119
+ #
120
+ #
121
+ # ### -X -x
122
+ #
123
+ # Assume X0201 kana in MS-Kanji. With **-X** or without this option, X0201 is
124
+ # converted into X0208 Kana. With **-x**, try to preserve X0208 kana and do not
125
+ # convert X0201 kana to X0208. In JIS output, ESC-(-I is used. In EUC output,
126
+ # SSO is used.
127
+ #
128
+ # ### -B[0-2]
129
+ #
130
+ # Assume broken JIS-Kanji input, which lost ESC. Useful when your site is using
131
+ # old B-News Nihongo patch.
132
+ #
133
+ # -B1
134
+ # : allows any char after ESC-( or ESC-$.
135
+ #
136
+ #
137
+ # -B2
138
+ # : forces ASCII after NL.
139
+ #
140
+ #
141
+ # ### -I
142
+ #
143
+ # Replacing non iso-2022-jp char into a geta character (substitute character in
144
+ # Japanese).
145
+ #
146
+ # ### -d -c
147
+ #
148
+ # Delete r in line feed, Add r in line feed.
149
+ #
150
+ # ### -m[BQN0]
151
+ #
152
+ # MIME ISO-2022-JP/ISO8859-1 decode. (DEFAULT) To see ISO8859-1 (Latin-1) -l is
153
+ # necessary.
154
+ #
155
+ # -mB
156
+ # : Decode MIME base64 encoded stream. Remove header or other part before
157
+ #
158
+ # conversion.
159
+ #
160
+ # -mQ
161
+ # : Decode MIME quoted stream. '_' in quoted stream is converted to space.
162
+ #
163
+ #
164
+ # -mN
165
+ # : Non-strict decoding.
166
+ #
167
+ # It allows line break in the middle of the base64 encoding.
168
+ #
169
+ # -m0
170
+ # : No MIME decode.
171
+ #
172
+ #
173
+ # ### -M
174
+ #
175
+ # MIME encode. Header style. All ASCII code and control characters are intact.
176
+ # Kanji conversion is performed before encoding, so this cannot be used as a
177
+ # picture encoder.
178
+ #
179
+ # -MB
180
+ # : MIME encode Base64 stream.
181
+ #
182
+ #
183
+ # -MQ
184
+ # : Perform quoted encoding.
185
+ #
186
+ #
187
+ # ### -l
188
+ #
189
+ # Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP. **-s**, **-e**
190
+ # and **-x** are not compatible with this option.
191
+ #
192
+ # ### -L[uwm]
193
+ #
194
+ # new line mode Without this option, nkf doesn't convert line breaks.
195
+ #
196
+ # -Lu
197
+ # : unix (LF)
198
+ #
199
+ #
200
+ # -Lw
201
+ # : windows (CRLF)
202
+ #
203
+ #
204
+ # -Lm
205
+ # : mac (CR)
206
+ #
207
+ #
208
+ # ### --fj --unix --mac --msdos --windows
209
+ #
210
+ # convert for these system
211
+ #
212
+ # ### --jis --euc --sjis --mime --base64
213
+ #
214
+ # convert for named code
215
+ #
216
+ # ### --jis-input --euc-input --sjis-input --mime-input --base64-input
217
+ #
218
+ # assume input system
219
+ #
220
+ # ### --ic=`input codeset` --oc=`output codeset`
221
+ #
222
+ # Set the input or output codeset. NKF supports following codesets and those
223
+ # codeset name are case insensitive.
224
+ #
225
+ # ISO-2022-JP
226
+ # : a.k.a. RFC1468, 7bit JIS, JUNET
227
+ #
228
+ #
229
+ # EUC-JP (eucJP-nkf)
230
+ # : a.k.a. AT&T JIS, Japanese EUC, UJIS
231
+ #
232
+ #
233
+ # eucJP-ascii
234
+ # : a.k.a. x-eucjp-open-19970715-ascii
235
+ #
236
+ #
237
+ # eucJP-ms
238
+ # : a.k.a. x-eucjp-open-19970715-ms
239
+ #
240
+ #
241
+ # CP51932
242
+ # : Microsoft Version of EUC-JP.
243
+ #
244
+ #
245
+ # Shift_JIS
246
+ # : SJIS, MS-Kanji
247
+ #
248
+ #
249
+ # Windows-31J
250
+ # : a.k.a. CP932
251
+ #
252
+ #
253
+ # UTF-8
254
+ # : same as UTF-8N
255
+ #
256
+ #
257
+ # UTF-8N
258
+ # : UTF-8 without BOM
259
+ #
260
+ #
261
+ # UTF-8-BOM
262
+ # : UTF-8 with BOM
263
+ #
264
+ #
265
+ # UTF-16
266
+ # : same as UTF-16BE
267
+ #
268
+ #
269
+ # UTF-16BE
270
+ # : UTF-16 Big Endian without BOM
271
+ #
272
+ #
273
+ # UTF-16BE-BOM
274
+ # : UTF-16 Big Endian with BOM
275
+ #
276
+ #
277
+ # UTF-16LE
278
+ # : UTF-16 Little Endian without BOM
279
+ #
280
+ #
281
+ # UTF-16LE-BOM
282
+ # : UTF-16 Little Endian with BOM
283
+ #
284
+ #
285
+ # UTF-32
286
+ # : same as UTF-32BE
287
+ #
288
+ #
289
+ # UTF-32BE
290
+ # : UTF-32 Big Endian without BOM
291
+ #
292
+ #
293
+ # UTF-32BE-BOM
294
+ # : UTF-32 Big Endian with BOM
295
+ #
296
+ #
297
+ # UTF-32LE
298
+ # : UTF-32 Little Endian without BOM
299
+ #
300
+ #
301
+ # UTF-32LE-BOM
302
+ # : UTF-32 Little Endian with BOM
303
+ #
304
+ #
305
+ # UTF8-MAC
306
+ # : NKDed UTF-8, a.k.a. UTF8-NFD (input only)
307
+ #
308
+ #
309
+ # ### --fb-{skip, html, xml, perl, java, subchar}
310
+ #
311
+ # Specify the way that nkf handles unassigned characters. Without this option,
312
+ # --fb-skip is assumed.
313
+ #
314
+ # ### --prefix= `escape character` `target character` ..
315
+ #
316
+ # When nkf converts to Shift_JIS, nkf adds a specified escape character to
317
+ # specified 2nd byte of Shift_JIS characters. 1st byte of argument is the escape
318
+ # character and following bytes are target characters.
319
+ #
320
+ # ### --no-cp932ext
321
+ #
322
+ # Handle the characters extended in CP932 as unassigned characters.
323
+ #
324
+ # ## --no-best-fit-chars
325
+ #
326
+ # When Unicode to Encoded byte conversion, don't convert characters which is not
327
+ # round trip safe. When Unicode to Unicode conversion, with this and -x option,
328
+ # nkf can be used as UTF converter. (In other words, without this and -x option,
329
+ # nkf doesn't save some characters)
330
+ #
331
+ # When nkf convert string which related to path, you should use this option.
332
+ #
333
+ # ### --cap-input
334
+ #
335
+ # Decode hex encoded characters.
336
+ #
337
+ # ### --url-input
338
+ #
339
+ # Unescape percent escaped characters.
340
+ #
341
+ # ### --
342
+ #
343
+ # Ignore rest of -option.
344
+ #
345
+ module NKF
346
+ # <!--
347
+ # rdoc-file=ext/nkf/nkf.c
348
+ # - NKF.guess(str) => encoding
349
+ # -->
350
+ # Returns guessed encoding of *str* by nkf routine.
351
+ #
352
+ def self.guess: (String str) -> Encoding
353
+
354
+ # <!--
355
+ # rdoc-file=ext/nkf/nkf.c
356
+ # - NKF.nkf(opt, str) => string
357
+ # -->
358
+ # Convert *str* and return converted result. Conversion details are specified by
359
+ # *opt* as String.
360
+ #
361
+ # require 'nkf'
362
+ # output = NKF.nkf("-s", input)
363
+ #
364
+ def self.nkf: (String opt, String str) -> String
365
+ end
366
+
367
+ NKF::ASCII: Encoding
368
+
369
+ NKF::AUTO: nil
370
+
371
+ NKF::BINARY: Encoding
372
+
373
+ NKF::EUC: Encoding
374
+
375
+ NKF::JIS: Encoding
376
+
377
+ # <!-- rdoc-file=ext/nkf/nkf.c -->
378
+ # Release date of nkf
379
+ #
380
+ NKF::NKF_RELEASE_DATE: String
381
+
382
+ # <!-- rdoc-file=ext/nkf/nkf.c -->
383
+ # Gem version of nkf gem
384
+ #
385
+ NKF::GEM_VERSION: String
386
+
387
+ NKF::NKF_VERSION: String
388
+
389
+ NKF::NOCONV: nil
390
+
391
+ NKF::SJIS: Encoding
392
+
393
+ NKF::UNKNOWN: nil
394
+
395
+ NKF::UTF16: Encoding
396
+
397
+ NKF::UTF32: Encoding
398
+
399
+ NKF::UTF8: Encoding
400
+
401
+ # <!-- rdoc-file=ext/nkf/nkf.c -->
402
+ # Full version string of nkf
403
+ #
404
+ NKF::VERSION: String
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nkf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: java
6
6
  authors:
7
7
  - NARUSE Yui
8
8
  - Charles Oliver Nutter
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2024-01-22 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Ruby extension for Network Kanji Filter
15
14
  email:
@@ -20,15 +19,13 @@ extensions: []
20
19
  extra_rdoc_files: []
21
20
  files:
22
21
  - ".git-blame-ignore-revs"
23
- - ".github/dependabot.yml"
24
- - ".github/workflows/test.yml"
25
22
  - ".gitignore"
23
+ - BSDL
24
+ - COPYING
26
25
  - Gemfile
27
- - LICENSE.txt
26
+ - LEGAL
28
27
  - README.md
29
28
  - Rakefile
30
- - bin/console
31
- - bin/setup
32
29
  - ext/java/org/jruby/ext/nkf/Command.java
33
30
  - ext/java/org/jruby/ext/nkf/CommandParser.java
34
31
  - ext/java/org/jruby/ext/nkf/NKFLibrary.java
@@ -46,6 +43,8 @@ files:
46
43
  - lib/nkf.jar
47
44
  - lib/nkf.rb
48
45
  - nkf.gemspec
46
+ - sig/kconv.rbs
47
+ - sig/nkf.rbs
49
48
  homepage: https://github.com/ruby/nkf
50
49
  licenses:
51
50
  - Ruby
@@ -55,7 +54,7 @@ licenses:
55
54
  metadata:
56
55
  homepage_uri: https://github.com/ruby/nkf
57
56
  source_code_uri: https://github.com/ruby/nkf
58
- post_install_message:
57
+ changelog_uri: https://github.com/ruby/nkf/releases
59
58
  rdoc_options: []
60
59
  require_paths:
61
60
  - lib
@@ -70,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
69
  - !ruby/object:Gem::Version
71
70
  version: '0'
72
71
  requirements: []
73
- rubygems_version: 3.3.26
74
- signing_key:
72
+ rubygems_version: 4.0.3
75
73
  specification_version: 4
76
74
  summary: Ruby extension for Network Kanji Filter
77
75
  test_files: []
@@ -1,6 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: 'github-actions'
4
- directory: '/'
5
- schedule:
6
- interval: 'weekly'
@@ -1,29 +0,0 @@
1
- name: build
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- ruby-versions:
7
- uses: ruby/actions/.github/workflows/ruby_versions.yml@master
8
- with:
9
- engine: cruby-jruby
10
- min_version: 2.5
11
-
12
- build:
13
- needs: ruby-versions
14
- name: build (${{ matrix.ruby }} / ${{ matrix.os }})
15
- strategy:
16
- matrix:
17
- ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
18
- os: [ ubuntu-latest, macos-latest ]
19
- runs-on: ${{ matrix.os }}
20
- steps:
21
- - uses: actions/checkout@v4
22
- - name: Set up Ruby
23
- uses: ruby/setup-ruby@v1
24
- with:
25
- ruby-version: ${{ matrix.ruby }}
26
- - name: Install dependencies
27
- run: bundle install
28
- - name: Run test
29
- run: rake compile test
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "nkf"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here