notepad doesn't recognize \n character?


I'm copying little css classes to one file. Classes get copied fine but I hv a issue that when I'm attempting to open it using notepad it gives one square Rather of char. It opens well in Edit+. Here is my code snippet:
String fileName = new File(oldFileName).getName();
BufferedWriter out = null;
FileWriter fw = new FileWriter("D:\\temp\\UPDATED_"+fileName);
out = new BufferedWriter(fw);
for (CSSStyleRule p : finlist.values()) {
String t = null;
String m = p.toString();
if (m.charAt(0) == '*') {
t = m.substring(1);
} else {
t = m;
}
String main = format(t);
out.write(main);
out.write("
");
}

also see this format() function
private static String format(String input) {
int s = input.indexOf('{');
int p = input.indexOf('}');
int w = input.indexOf(';');
if(w==-1)
{
w=p-1;
String part=input.split("}");
input= part0.concat(";").concat("}");
}
String m = input.substring(0 s).trim().concat("{
")
.concat(input.substring(s + 1 w + 1).trim())
.concat(input.substring(w + 1 p));
String a = m.split(";");
String main = "";
for (String segment : a) {
if (segment.having("rgb")) {
segment = change(segment);
}
if(segment.having("FONT-FAMILY") || segment.having("font-family")){
part=process(segment);
}
main = main.concat(segment.trim().concat(";")).concat("
");
}
main = main.concat("}");
return main;
}

How can i make it show up properly in notepad?



Get Source Code

  Views 35   Posted on : Tuesday, May 21, 2013 11:42:39 AM
Related Tags:




Replies on "notepad doesn't recognize \n character?" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: