Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I assume this is related to <a href="https://stackoverflow.com/questions/2671284/utf-8-formatting-in-sparql/2673973#2673973">UTF-8 formatting in SPARQL</a>?</p> <p>Having looked at it here's what's happened:</p> <ul> <li>Importer took input 'Chodovská tvrz' encoded in utf-8.</li> <li>In utf-8 that's: '43 68 6f 64 6f 76 73 6b c3 a1 20 74 76 72 7a' (c3 a1 is 'á' in utf-8)</li> <li>Importer read those bytes instead as unicode characters.</li> <li>So instead of 'á' you get the two characters c3 a1, which are 'Ã' and '¡'.</li> </ul> <p>You can reverse that by turning the characters of the string to a byte array, then making a new string from it. I'm sure there must be a simpler way, but here's an example:</p> <pre><code>public class Convert { public static void main(String... args) throws Exception { String in = "Chodovsk\u00C3\u00A1 tvrz"; char[] chars = in.toCharArray(); // make a new string by treating chars as bytes String out = new String(fix(chars), "utf-8"); System.err.println("Got: " + out); // Chodovská tvrz } public static byte[] fix(char[] a) { byte[] b = new byte[a.length]; for (int i = 0; i &lt; a.length; i++) b[i] = (byte) a[i]; return b; } } </code></pre> <p>Using this on <code>list.get(i).get("churchname").toString()</code> (which is what you are printing) will fix those names.</p> <p>Edit:</p> <p>Or just use:</p> <pre><code>String churchname = list.get(i).get("churchname").toString(); String out2 = new String(churchname.getBytes("iso-8859-1"), "utf-8"); </code></pre> <p>Which is much simpler.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload