projects
/
booh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d400167
)
ruby 1.9 array stringification has changed, I need to use iconv the proper way now
author
Guillaume Cottenceau
<gcottenc@gmail.com>
Sun, 5 Sep 2010 21:11:58 +0000
(23:11 +0200)
committer
Guillaume Cottenceau
<gcottenc@gmail.com>
Sun, 5 Sep 2010 21:11:58 +0000
(23:11 +0200)
lib/booh/booh-lib.rb
patch
|
blob
|
history
diff --git
a/lib/booh/booh-lib.rb
b/lib/booh/booh-lib.rb
index 0f034cdc6dffc486d5c6620d341da2cc90c715e7..cbead63b3ac86891af414a05223789e448c2fd37 100644
(file)
--- a/
lib/booh/booh-lib.rb
+++ b/
lib/booh/booh-lib.rb
@@
-55,7
+55,7
@@
module Booh
def utf8(string)
begin
def utf8(string)
begin
- return Iconv
::iconv("UTF-8", $CURRENT_CHARSET, string).to_s
+ return Iconv
.conv("UTF-8", $CURRENT_CHARSET, string)
rescue
return "???"
end
rescue
return "???"
end
@@
-63,7
+63,7
@@
module Booh
def utf8cut(string, maxlen)
begin
def utf8cut(string, maxlen)
begin
- return Iconv
::iconv("UTF-8", $CURRENT_CHARSET, string[0..maxlen-1]).to_s
+ return Iconv
.conv("UTF-8", $CURRENT_CHARSET, string[0..maxlen-1])
rescue Iconv::InvalidCharacter
return utf8cut(string, maxlen-1)
rescue
rescue Iconv::InvalidCharacter
return utf8cut(string, maxlen-1)
rescue
@@
-92,12
+92,12
@@
module Booh
end
def from_utf8(string)
end
def from_utf8(string)
- return Iconv
::iconv($CURRENT_CHARSET, "UTF-8", string).to_s
+ return Iconv
.conv($CURRENT_CHARSET, "UTF-8", string)
end
def from_utf8_safe(string)
begin
end
def from_utf8_safe(string)
begin
- return Iconv
::iconv($CURRENT_CHARSET, "UTF-8", string).to_s
+ return Iconv
.conv($CURRENT_CHARSET, "UTF-8", string)
rescue Iconv::IllegalSequence
return ''
end
rescue Iconv::IllegalSequence
return ''
end