Created
January 7, 2009 17:22
-
-
Save masuidrive/44343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'kconv' | |
require 'iconv' | |
require 'nkf' | |
require 'test/unit' | |
class GuessEncoding < Test::Unit::TestCase | |
def setup | |
# EUC-JP encoded うまく表示してね! | |
@euc = "¥345¥341¥254¥345¥242¥300¥345¥341¥276¥352¥241¥243¥245¥243¥356¥246¥245¥263¥345¥341¥316¥345¥242¥250¥345¥341¥245¥345¥376¥276" | |
end | |
def test_guess_encoding | |
tmp = NKF.guess(@euc) | |
# enc = NKF.constants.find { |c| NKF.const_get(c) == tmp } | |
assert_equal NKF::EUC, tmp | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment