Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
add utf8 -> utf-8 alias
· ead98826
Marcin Mielzynski
authored
Jul 23, 2019
ead98826
Avoid calling Java 9+ version of *Buffer.position.
· 4cbf09e6
Charles Oliver Nutter
authored
Oct 01, 2019
Fixes #27.
4cbf09e6
[maven-release-plugin] prepare release jcodings-1.0.45
· 3709fc51
Charles Oliver Nutter
authored
Oct 01, 2019
3709fc51
[maven-release-plugin] prepare for next development iteration
· c5ded8fe
Charles Oliver Nutter
authored
Oct 01, 2019
c5ded8fe
Show whitespace changes
Inline
Side-by-side
pom.xml
View file @
c5ded8fe
...
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.jruby.jcodings
</groupId>
<artifactId>
jcodings
</artifactId>
<version>
1.0.4
5
-SNAPSHOT
</version>
<version>
1.0.4
6
-SNAPSHOT
</version>
<name>
JCodings
</name>
<description>
Byte based encoding support library for java
</description>
<parent>
...
...
scripts/generate.rb
View file @
c5ded8fe
...
...
@@ -80,6 +80,7 @@ def generate_encoding_list
defines
,
other
=
open
(
"
#{
REPO_PATH
}
/encdb.h"
).
read
.
tr
(
'()'
,
''
).
scan
(
/ENC_([A-Z_]+)(.*?);/m
).
partition
{
|
a
,
b
|
a
=~
/DEFINE/
}
other
<<
[
"ALIAS"
,
"
\"
MS932
\"
,
\"
Windows-31J
\"
"
]
other
<<
[
"ALIAS"
,
"
\"
UTF8
\"
,
\"
UTF-8
\"
"
]
open
(
"
#{
SRC_DIR
}
/EncodingList.java"
,
"wb"
)
{
|
f
|
f
<<
open
(
"EncodingListTemplate.java"
,
"rb"
).
read
.
sub
(
/%\{defines\}/
,
defines
.
map
{
|
cmd
,
name
|
"
#{
INDENT
*
2
}
EncodingDB.declare(
#{
name
}
,
\"
#{
enc_map
[
name
[
/[^"]+/
]]
||
(
raise
'class not found for encoding '
+
name
)
}
\"
);"
}.
join
(
"
\n
"
)).
...
...
src/org/jcodings/EncodingList.java
View file @
c5ded8fe
...
...
@@ -194,6 +194,7 @@ final class EncodingList {
EncodingDB
.
replicate
(
"UTF8-SoftBank"
,
"UTF-8"
);
EncodingDB
.
replicate
(
"SJIS-SoftBank"
,
"Windows-31J"
);
EncodingDB
.
alias
(
"MS932"
,
"Windows-31J"
);
EncodingDB
.
alias
(
"UTF8"
,
"UTF-8"
);
}
public
static
Encoding
getInstance
(
String
name
)
{
...
...
src/org/jcodings/spi/ISO_8859_16.java
View file @
c5ded8fe
...
...
@@ -20,6 +20,7 @@
package
org.jcodings.spi
;
import
java.nio.Buffer
;
import
java.nio.ByteBuffer
;
import
java.nio.CharBuffer
;
import
java.nio.charset.Charset
;
...
...
@@ -174,7 +175,7 @@ public class ISO_8859_16 extends Charset {
if
(
replace
!=
null
)
{
if
(
out
.
remaining
()
<
replace
.
length
)
{
in
.
position
(
in
.
position
()
-
1
);
((
Buffer
)
in
)
.
position
(
in
.
position
()
-
1
);
return
CoderResult
.
OVERFLOW
;
}
else
{
out
.
put
(
replace
);
...
...