Permalink
Browse files

Rubery version of the UnicodeFileToHtmlTextConverter original problem

  • Loading branch information...
1 parent b6e6f80 commit f1f84cbbb2e9e938e18d665699c77778dab3c555 Sam Serpoosh committed Sep 12, 2012
@@ -0,0 +1,18 @@
+class UnicodeFileToHtmTextConverter
+ def initialize(full_file_name_with_path)
+ @full_file_name_with_path = full_file_name_with_path
+ end
+
+ def convert_to_html
+ html = ""
+
+ text = File.open(@full_file_name_with_path).read # Not exactly the same code in CSharp but same functionality!
+ text.gsub!(/\r\n?/, "\n")
+ text.each_line do |line|
+ html += HttpUtility.html_encode(line)
+ html += "<br />"
+ end
+
+ return html
+ end
+end

0 comments on commit f1f84cb

Please sign in to comment.