Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr authored Sep 18, 2017
2 parents 7f5d912 + bcd0b1e commit 9594e0a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Here are some projects that use tm4e:
* [Eclipse aCute](https://github.com/eclipse/aCute) C# edition in Eclipse IDE.
* [LiClipseText](http://www.liclipse.com/text/) enables Eclipse to be used as a general-purpose text editor, providing support for several languages out of the box.
* [typescript.java](https://github.com/angelozerr/typescript.java) TypeScript IDE for Eclipse with JSDT & tsserver.
* [EditorConfig for Eclipse](https://github.com/angelozerr/ec4e) EditorConfig for Eclipse with GenericEditor.

## Get support and contribute

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.eclipse.tm4e.core.internal.oniguruma;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

import org.jcodings.specific.UTF8Encoding;
import org.joni.Matcher;
Expand All @@ -44,12 +44,7 @@ public OnigRegExp(String source) {
lastSearchStrUniqueId = null;
lastSearchPosition = -1;
lastSearchResult = null;
byte[] pattern;
try {
pattern = source.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
byte[] pattern = source.getBytes(StandardCharsets.UTF_8);
this.regex = new Regex(pattern, 0, pattern.length, Option.CAPTURE_GROUP, UTF8Encoding.INSTANCE, Syntax.DEFAULT,
WarnCallback.DEFAULT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.eclipse.tm4e.core.internal.oniguruma;

import java.nio.charset.Charset;
import java.util.Arrays;

import org.jcodings.specific.UTF8Encoding;
import java.nio.charset.StandardCharsets;

/**
* Oniguruma string.
Expand All @@ -31,8 +31,6 @@
*/
public class OnigString {

private static final String UTF_8 = "UTF-8";

private final String str;
private final Object uniqueId;
private final byte[] value;
Expand All @@ -43,7 +41,7 @@ public class OnigString {

public OnigString(String str) {
this.str = str;
this.value = str.getBytes(Charset.forName(UTF_8));
this.value = str.getBytes(StandardCharsets.UTF_8);
this.uniqueId = new Object();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

import org.eclipse.tm4e.core.internal.parser.PList;

Expand All @@ -29,7 +30,7 @@ public JSONPListParser(boolean theme) {

public T parse(InputStream contents) throws Exception {
PList<T> pList = new PList<T>(theme);
JsonReader reader = new JsonReader(new InputStreamReader(contents, Charset.forName("UTF-8")));
JsonReader reader = new JsonReader(new InputStreamReader(contents, StandardCharsets.UTF_8));
// reader.setLenient(true);
boolean parsing = true;
while (parsing) {
Expand Down

0 comments on commit 9594e0a

Please sign in to comment.