• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Revision3d504966e4908105c8f406664852982d5d7e34d9 (tree)
Zeit2009-09-22 20:21:06
Autorikeji <ikeji@f836...>
Commiterikeji

Log Message

Convert to utf8 before save.

git-svn-id: http://dev.ikejima.org/src/svn/pragger/trunk@410 f8368ae4-1e99-dc11-9799-0018f35ab5fa

Ändern Zusammenfassung

Diff

--- a/plugin/RSS/save.rb
+++ b/plugin/RSS/save.rb
@@ -11,6 +11,7 @@
1111 ## description: sample rdf
1212
1313 require "rss/maker"
14+require "kconv"
1415
1516 @count = Time.now.to_i
1617
@@ -26,17 +27,17 @@ def save(config,data)
2627 i.setup_maker(maker)
2728 else
2829 item = maker.items.new_item
29- item.title = i.title rescue i.to_s
30+ item.title = i.title.toutf8 rescue i.to_s.toutf8
3031 begin
31- item.link = i.link
32+ item.link = i.link.toutf8
3233 rescue
3334 if i.to_s =~ %r|^https?://|
34- item.link = i.to_s
35+ item.link = i.to_s.toutf8
3536 else
3637 item.link = (config['link'] || "http://example.net/") + "\##{@count}"
3738 end
3839 end
39- item.description = i.description rescue i.to_s
40+ item.description = i.description.toutf8 rescue i.to_s.toutf8
4041 item.date = i.date rescue Time.now
4142 @count += 1
4243 end