You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2005/09/03 01:22:28 UTC

DO NOT REPLY [Bug 36483] New: - german umlaut are not correct converted to XML while writing svg to file

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36483>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36483

           Summary: german umlaut are not correct converted to XML while
                    writing svg to file
           Product: Batik
           Version: 1.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SVG DOM
        AssignedTo: batik-dev@xml.apache.org
        ReportedBy: j.lolling@t-online.de


The methode DOMUtilities.contentToString do not convert german umlauts.
I suggest to change this methode like this:

    public static String contentToString(String s) {
        StringBuffer result = new StringBuffer();

        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);

            switch (c) {
            case '<':
                result.append("&#60;");
                break;
            case '>':
                result.append("&#62;");
                break;
            case '&':
                result.append("&#38;");
                break;
            case '"':
                result.append("&#34;");
                break;
            case '\'':
                result.append("&#39;");
                break;
            case '�':
                result.append("&#228;");
                break;
            case '�':
                result.append("&#196;");
                break;
            case '�':
                result.append("&#252;");
                break;
            case '�':
                result.append("&#220;");
                break;
            case '�':
                result.append("&#246;");
                break;
            case '�':
                result.append("&#214;");
                break;
            case '�':
                result.append("&#223;");
                break;
            default:
                result.append(c);
            }
        }
        
        return result.toString();
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org