I have a string in my maven project and when I run it on my local machine, I have
String name = title.get(i).text().replace("é", "e");
Later I save the variable name to a file
But then when I export to .jar and run the it on my server I see é not e, but when I run on my local machine I see "e" which is what I want.
What is happening?
Srijani Ghosh
4,2667 gold badges42 silver badges70 bronze badges
asked Aug 23, 2015 at 23:18
spen123
3,53411 gold badges41 silver badges56 bronze badges
1 Answer 1
If you are trying to change that from a web page you may want to try:
String name = title.get(i).text().replace("%C3%A9", "e");
Sign up to request clarification or add additional context in comments.
Comments
lang-java
title?String.replace.'\u00e9'when you run the program locally, whereas the strings on your server contain the sequence'\u0065\u0301'. If that's the case, you can create a Matcher outside your loop usingMatcher matcher = Pattern.compile("e", Pattern.CANON_EQ).matcher("");, and inside your loop, you can doString name = matcher.reset(title.get(i).text()).replaceAll("e");.