• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenRefine / OpenRefine / 22594630641

02 Mar 2026 08:35PM UTC coverage: 71.081% (+20.4%) from 50.692%
22594630641

Pull #7689

github

web-flow
Merge 583e5f2e4 into 91977f2bf
Pull Request #7689: client: get encodings using API rather than Velocity injection

3457 of 5571 branches covered (62.05%)

Branch coverage included in aggregate %.

0 of 13 new or added lines in 1 file covered. (0.0%)

9988 of 13344 relevant lines covered (74.85%)

3.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/main/src/com/google/refine/commands/GetEncodingsCommand.java
1

2
package com.google.refine.commands;
3

4
import java.io.IOException;
5
import java.nio.charset.Charset;
6
import java.util.ArrayList;
7
import java.util.List;
8
import java.util.Map;
9
import java.util.SortedMap;
10

11
import javax.servlet.ServletException;
12
import javax.servlet.http.HttpServletRequest;
13
import javax.servlet.http.HttpServletResponse;
14

15
/**
16
 * Returns the list of available character encodings.
17
 */
NEW
18
public class GetEncodingsCommand extends Command {
×
19

20
    @Override
21
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
NEW
22
        SortedMap<String, Charset> charsets = Charset.availableCharsets();
×
NEW
23
        List<Map<String, Object>> encodings = new ArrayList<>();
×
24

NEW
25
        for (Map.Entry<String, Charset> entry : charsets.entrySet()) {
×
NEW
26
            String code = entry.getKey();
×
NEW
27
            Charset charset = entry.getValue();
×
28

NEW
29
            Map<String, Object> encoding = Map.of(
×
30
                    "code", code,
NEW
31
                    "name", charset.displayName(),
×
NEW
32
                    "aliases", new ArrayList<>(charset.aliases()));
×
33

NEW
34
            encodings.add(encoding);
×
NEW
35
        }
×
36

NEW
37
        respondJSON(response, encodings);
×
NEW
38
    }
×
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc