Skip to content

Commit

Permalink
use utf-8 file encoding; closes #226
Browse files Browse the repository at this point in the history
  • Loading branch information
wea_ondara committed Feb 10, 2016
1 parent 53b964b commit 63a55c6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -138,6 +138,6 @@
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
2 changes: 1 addition & 1 deletion src/main/java/net/alpenblock/bungeeperms/ChatColor.java
Expand Up @@ -33,7 +33,7 @@ public enum ChatColor

static String strip(String text)
{
return text.replaceAll(.", "");
return text.replaceAll(COLOR_CHAR + ".", "");
}

private final char code;
Expand Down
Expand Up @@ -39,7 +39,6 @@ public static void extract(String file, String dest)
f.getParentFile().mkdirs();
try
{
//file öffnen
ClassLoader cl = FileExtractor.class.getClassLoader();
URL url = cl.getResource(file);
if (url != null)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/alpenblock/bungeeperms/Lang.java
Expand Up @@ -30,7 +30,7 @@ public static String translate(MessageType type, Object... vars)
s = type.getDefaultValue();
}
s = Statics.format(s, vars);
return s.replaceAll("&", ");
return s.replaceAll("&", ChatColor.COLOR_CHAR + "");
}

@AllArgsConstructor
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/alpenblock/bungeeperms/User.java
Expand Up @@ -684,9 +684,9 @@ public String buildPrefix(Sender sender)

for (String p : prefixes)
{
if (!ChatColor.strip(p.replaceAll("&", ")).isEmpty()
if (!ChatColor.strip(p.replaceAll("&", ChatColor.COLOR_CHAR + "")).isEmpty()
&& !prefix.isEmpty()
&& !ChatColor.strip(prefix.replaceAll("&", ")).endsWith(" "))
&& !ChatColor.strip(prefix.replaceAll("&", ChatColor.COLOR_CHAR + "")).endsWith(" "))
{
prefix += " ";
}
Expand Down Expand Up @@ -763,9 +763,9 @@ public String buildSuffix(Sender sender)

for (String suf : suffixes)
{
if (!ChatColor.strip(suf.replaceAll("&", ")).isEmpty()
if (!ChatColor.strip(suf.replaceAll("&", ChatColor.COLOR_CHAR + "")).isEmpty()
&& !suffix.isEmpty()
&& !ChatColor.strip(suffix.replaceAll("&", ")).endsWith(" "))
&& !ChatColor.strip(suffix.replaceAll("&", ChatColor.COLOR_CHAR + "")).endsWith(" "))
{
suffix += " ";
}
Expand Down
Expand Up @@ -2,6 +2,7 @@

import java.util.logging.Logger;
import net.alpenblock.bungeeperms.BungeePerms;
import net.alpenblock.bungeeperms.ChatColor;
import net.alpenblock.bungeeperms.Group;
import net.alpenblock.bungeeperms.Server;
import net.alpenblock.bungeeperms.User;
Expand Down Expand Up @@ -98,7 +99,7 @@ public String getPlayerPrefix(String world, String player)
@Override
public void setPlayerPrefix(String world, String player, String prefix)
{
prefix = prefix.replaceAll("&", ");
prefix = prefix.replaceAll("&", ChatColor.COLOR_CHAR + "");

User u = perms.getPermissionsManager().getUser(player);
if (u == null)
Expand All @@ -120,7 +121,7 @@ public String getPlayerSuffix(String world, String player)
@Override
public void setPlayerSuffix(String world, String player, String suffix)
{
suffix = suffix.replaceAll("&", ");
suffix = suffix.replaceAll("&", ChatColor.COLOR_CHAR + "");

User u = perms.getPermissionsManager().getUser(player);
if (u == null)
Expand All @@ -143,7 +144,7 @@ public String getGroupPrefix(String world, String group)
@Override
public void setGroupPrefix(String world, String group, String prefix)
{
prefix = prefix.replaceAll("&", ");
prefix = prefix.replaceAll("&", ChatColor.COLOR_CHAR + "");

Group g = perms.getPermissionsManager().getGroup(group);
if (g == null)
Expand All @@ -166,7 +167,7 @@ public String getGroupSuffix(String world, String group)
@Override
public void setGroupSuffix(String world, String group, String suffix)
{
suffix = suffix.replaceAll("&", ");
suffix = suffix.replaceAll("&", ChatColor.COLOR_CHAR + "");

Group g = perms.getPermissionsManager().getGroup(group);
if (g == null)
Expand Down

0 comments on commit 63a55c6

Please sign in to comment.