1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>locale_charset (Mconv)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre><span class="ruby-comment cmt"># File mconv.rb, line 64</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Mconv</span>.<span class="ruby-identifier">locale_charset</span>
<span class="ruby-identifier">codeset</span> = <span class="ruby-constant">Mconv</span>.<span class="ruby-identifier">locale_codeset</span>
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">codeset</span>
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A(?:euc-jp|eucjp|ujis)\z/i</span>
<span class="ruby-value str">'euc-jp'</span>
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A(?:euc-kr|euckr)\z/i</span>
<span class="ruby-value str">'euc-kr'</span>
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A(?:shift_jis|sjis)\z/i</span>
<span class="ruby-value str">'shift_jis'</span>
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A(?:utf-8|utf8)\z/i</span>
<span class="ruby-value str">'utf-8'</span>
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A(?:iso-8859-1|iso8859-1|us-ascii|ANSI_X3.4-1968)\z/i</span>
<span class="ruby-value str">'iso-8859-1'</span>
<span class="ruby-keyword kw">else</span>
<span class="ruby-value str">'utf-8'</span>
<span class="ruby-keyword kw">end</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
|