Unityであった.csファイルの文字コード絡みのエラー

※本ページは、アフィリエイト広告を利用しています

最近始めたUnityでのエラーメモ。

この本を見ながらソース書いて実行してみると問題なさそうなところでつまづきまくるからずっと調べてたら、ソース書いてる.csファイルの文字コードが原因でソース中の日本語部分でエラーを起こしてた様子。

スマホで見る

Unityであった.csファイルの文字コード絡みのエラー

Warning: Undefined variable $subtitle_text__shortcode_amazon__amazon in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 11

Warning: Undefined variable $subtitle_text__shortcode_amazon__rakuten in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 12

Warning: Undefined variable $subtitle_text__shortcode_kindle__kindle in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 26

Warning: Undefined variable $subtitle_text__shortcode_kindle__rakuten in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 27

Warning: Undefined variable $subtitle_text__shortcode__amazon in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 30

Warning: Undefined variable $html_btn_affiliate in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 69

Warning: Undefined variable $html_star in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 103

Warning: Undefined variable $html_review in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 104

Warning: Undefined variable $subtitle_text__shortcode_amazon__amazon in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 11

Warning: Undefined variable $subtitle_text__shortcode_amazon__rakuten in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 12

Warning: Undefined variable $subtitle_text__shortcode_kindle__kindle in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 26

Warning: Undefined variable $subtitle_text__shortcode_kindle__rakuten in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 27

Warning: Undefined variable $subtitle_text__shortcode__amazon in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/affiliate_subtitle_text.php on line 30

Warning: Undefined variable $html_btn_affiliate in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 69

Warning: Undefined variable $html_star in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 103

Warning: Undefined variable $html_review in /home/t74/koreyome.com/public_html/wp-content/themes/tech/functions/shortcode_amazon.php on line 104

ちなみに

  • ○ … Shift-JIS(Unityデフォで作ったらコレだった)
  • × … UTF-8(何かのきっかけでUTF-8になった?)
  • ○ … UTF-16(参考書内のファイルの文字コード)

って感じ。いつUTF-8になったんだろうな…
.csファイルはc#ソースの拡張子みたいだけど、通常の文字コードってなんだろ?ちょこっと調べたくらいだとちゃんとした答えは出なかったなー。

まぁデフォでShift-JISだったしMac環境でも作業すること考えたらShift-JISでいった方がいいのかね。

余談でc#の話し。

サンプルが簡単なのかもしれないけど、今のところまだよくわからんような特殊な書き方してるとこないからわかりやすい。 こないだ触ってたコマンドプロンプト内のコードの方がよっぽどわかりにくいや。

Unityで作るスマートフォン3Dゲーム開発講座 Unity4対応 (Smart Game Developer)

Unityで作るスマートフォン3Dゲーム開発講座 Unity4対応 (Smart Game Developer)

Unity入門 ~高機能ゲームエンジンによるマルチプラットフォーム開発~

Unity入門 ~高機能ゲームエンジンによるマルチプラットフォーム開発~

Share