Comments (10)
I've added the capability of specifying the file encoding via the Tools->Options menu for now. This is stored in the config.properties file so will be remembered the next time the application is started. Sadly Java doesn't seem to be able to determine automatically what the file encoding is when reading it.
I've made a jar file and Windows installer available here.
Let me know if this has sorted the problem out.
from sldeditor.
Hmm, not working. I'm attaching sample test style so you could see exactly what I see.
test.txt
P.S. It seems there are more than one problematic char, not in this test case. Not yet localized it (or them) because the style is really huge.
from sldeditor.
I downloaded the file and loaded it up in UTF-8 and windows-1251 and got the following:
I think that implies that the test.txt file is UTF-8
from sldeditor.
I tried to reach above result (your screens) on two different Windows machines. I have just deleted and installed the latest java. No use.
Next I changed language for non-Unicode programs from russian to english and now the error is byte "1 of 1-byte..." instead of "byte 2 of 2-byte..." but error is still here.
Then I asked my ubuntu-colleague to download jar and test sld...it worked just like on your screens.
What OS do you use when testing my sld?
from sldeditor.
I've tested it on Windows 7 Java 1.8 rev 191 and Ubuntu Bionic Beaver 18.04 Java 1.8 rev 192.
What locale are you using?
from sldeditor.
Previous was Russian, it gave "byte 2 of 2-byte..."
current is English (UK), it gives "1 of 1-byte..."
from sldeditor.
What happens if you replace the first line of the sld file with the following:
<?xml version="1.0" encoding="windows-1251"?>
from sldeditor.
Issue is solved by adding env. variable JAVA_TOOL_OPTIONS with -Dfile.encoding=UTF-8 value or by modifying target field of the shortcut with "java -Dfile.encoding=UTF-8 -jar %JAR_LOCATION%\SLDEditor.jar".
So the solution isn't about changing the app - just about changing java setting.
from sldeditor.
I've just done an experiment and the call I used to get the 'system file encoding' was Charset.defaultCharset() and is overridden by the system property -Dfile.encoding. So calling Charset.defaultCharset() on my machines returns UTF-8 it returns something else on yours and is reset by using the -Dfile.encoding system property.
I've updated the code so that the file encoding is fixed to UTF-8 (I think this is as per the SLD specification) and removed the ability for the user to change it via the user interface. This will mean you wont need to set the -Dfile.encoding system property.
from sldeditor.
Thanks! Looking forward to get new version)
from sldeditor.
Related Issues (20)
- Allow background render colour to be set HOT 2
- Update date picker ui component HOT 1
- Support multiple monitors HOT 1
- Add ability to specify math expression in filters HOT 1
- Ignore pre-release builds HOT 1
- link to MacOS/Windows installers failed HOT 1
- Store property file in user folder HOT 1
- Unit tests not tidied up after themselves HOT 1
- Create release 0.8.3 HOT 1
- BBox filters cause crash
- sld editor crash when attempting running HOT 1
- QGIS svg color not recognized HOT 3
- Unable to connect SLD Editor to Oracle
- Unable to connect to PostGIS database HOT 2
- Error - java.lang.NullPointerException
- Fix security vulnerabilites
- Allow relative paths in SLD files
- Adding tweaks for OpenLayers (as a Vendor Option?)
- PropertyIsLike Filter - escape[Char]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sldeditor.