電子書籍の厳選無料作品が豊富!

●質問の主旨

eclipseが文字化けして困っています。

関連質問

eclipseの文字化けについて(PHPファイル)
http://okwave.jp/qa/q8068188.html

「eclipse」「文字化け」でググってみて、
上位5~6番目に表示される方法を試してみましたが、
どれも効果が上がらず、依然日本語が文字化けしたままです。


ひょっとしたら、eclipseの文字化けを直そうと思ったら、
PHPの日本語設定変更しないといけないのでしょうか?


もしその場合、変更するのは、下記のサイトに従って
やるのが良いのでしょうか?それとも何か他の方法があるのでしょうか?


日本語利用の為の設定
http://www.phpbook.jp/install/phpini/index5.html


ご存知の方、よろしくお願いします。


●質問の補足

なお、eclipseを通してUPしたPHPファイルは文字化けを起こしますが、
xammp直下にあるhtdocsにおいてUpしたファイルは文字化けを起こしません。

●開発環境

windows1.8.1
xammp1.8.1

A 回答 (2件)

お疲れ様です。


自分用の備忘録代わりのエクセル・ファイルですが
何かの参考になれば幸いです。

http://www.hesaka.in.arena.ne.jp/iK/PHP_mbstring …

参考URL:http://www.hesaka.in.arena.ne.jp/iK/PHP_mbstring …
    • good
    • 0
この回答へのお礼

kinta03さま
ご回答ありがとうございます!
頂いたアドバイスは、
今後の参考といたします。
大変助かります!

自分でもいろいろ調べていると、
このような設定方法もありました。

http://phpjavascriptroom.com/?t=php&p=xampp
「PHPファイルの文字コード、出力をutf-8に設定する」

お礼日時:2013/05/07 17:59

eclipseのエディターの文字コード


phpファイルの文字コード
htmlのcharsetに設定している文字コード
は、それぞれどのように設定していますか。

この回答への補足

自分でもいろいろ調べていると、
このような設定方法もありました。

http://phpjavascriptroom.com/?t=php&p=xampp
「PHPファイルの文字コード、出力をutf-8に設定する」

今後ともよろしくお願いします。

補足日時:2013/05/07 17:59
    • good
    • 0
この回答へのお礼

t_ohtaさま
ご回答ありがとうございます!
順不同ですが次のとおりです。

・eclipseのエディターの文字コード
→UTF-8

(ウィンドウ→設定→一般→ワークスペース
→テキスト・ファイルのエンコード→その他)

・htmlのcharsetに設定している文字コード
→UTF-8

(HTMLを書くときはこの文字コードで宣言しているので)

・phpファイルの文字コード

→特定できません。

http://www.phpbook.jp/install/phpini/index5.html
このサイトに従って、自分のphp.iniから[mbstring]を
コピペすると次のコードになります。

このサイトの下部にある「最終的な記述」
とは異なりますが、この通りにやって良いのかどうか、
決めかねております。


[mbstring]
; language for internal character representation.
; http://php.net/mbstring.language
;mbstring.language = Japanese

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
; http://php.net/mbstring.internal-encoding
;mbstring.internal_encoding = EUC-JP

; http input encoding.
; http://php.net/mbstring.http-input
;mbstring.http_input = auto

; http output encoding. mb_output_handler must be
; registered as output buffer to function
; http://php.net/mbstring.http-output
;mbstring.http_output = SJIS

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
; http://php.net/mbstring.encoding-translation
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
; http://php.net/mbstring.substitute-character
;mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
; http://php.net/mbstring.func-overload
;mbstring.func_overload = 0

; enable strict encoding detection.
;mbstring.strict_detection = Off

; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
;mbstring.http_output_conv_mimetype=

; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
; Default: ""
;mbstring.script_encoding=

お礼日時:2013/05/03 21:27

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!