タグ

ブックマーク / memo.xight.org (2)

  • memo.xight.org - PHPの文字化け - 5つの誤解と5つの対策

    Summary 設定すべき項目は以下. ;; Disable Output Buffering output_buffering = Off ;; Set HTTP header charset ; default_charset = EUC-JP ;; Set default language to Japanese mbstring.language = Japanese ;; HTTP input encoding translation is enabled. mbstring.encoding_translation = off ;; Set HTTP input encoding conversion to auto mbstring.http_input = pass ;; Convert HTTP output to EUC-JP mbstring.http_output

    tsupo
    tsupo 2007/02/15
    「デフォルトの文字コードのことではない」のになぜ default_charset という名前にしたのか? 「内部エンコードのことではない」のになぜ internal_encoding という名前にしたのか? 誤解させるのが目的?
  • UTF-8で変換できない機種依存文字を置換する

    Summary UTF-8 のページから (株) や ローマ数字の I などの文字をメールで送信すると,文字化けする. 文字化けしそうな文字を,ad hoc に機種依存しない文字に変換する. ローマ数字もカッコで括るか,スペースを挿入したほうが良いかも. Source function replaceText($str){ $arr = array( /* --- 0x2100 - 0x2138 (文字種記号) --- */ // 0x2100 - 0x210F '\xE2\x84\x80' => 'a/c', '\xE2\x84\x81' => 'a/s', '\xE2\x84\x82' => 'C', '\xE2\x84\x83' => '?', '\xE2\x84\x84' => '?', '\xE2\x84\x85' => 'c/o', '\xE2\x84\x86' => 'c/u

    tsupo
    tsupo 2006/06/21
    実は、bookey の内部でもよく似たことをやってます
  • 1