Skip to content

Commit

Permalink
Fixes for #5 - removal of all non standard characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
splatch committed Dec 28, 2018
1 parent 16ef598 commit fdbbe7d
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,9 @@ private static String openhabType(Property property) {
}

private static String openhabName(Property property) {
return property.getName()
.replace(" ", "_")
.replaceAll("\\)$", "")
.replaceAll("}$", "")
.replaceAll("]$", "")
.replace(":|;|\\.", "_")
.replace("(", "_")
.replace(")", "_")
.replace("{", "_")
.replace("}", "_")
.replace("[", "_")
.replace("]", "_")
return property.getName().trim()
.replaceAll("[^a-zA-Z0-9\\s]", "")
.replaceAll("\\s", "_")
// in the end - we replace non ascii characters
.replaceAll("[^\\x00-\\x7F]", "_");
}
Expand Down

0 comments on commit fdbbe7d

Please sign in to comment.