- Home /
Why have Chinese compile the script will fail???
Today, I set the platform for the PC AND MAC - when I wrote the following code - i get some error when i compile that. But when I put the platform to build the Web Player can also display Chinese ~ ~ Why does this child? All available platforms tested, only can be compiled only Web Play... Is there solution to it???
My English is poor, so sorry.
using UnityEngine;
using System.Collections;
public class NewBehaviourScript: MonoBehaviour
{
//Use this for initializatio
void Start ()
{
}
//Update is called once per frame
void Update ()
{
}
void OnGUI ()
{
GUILayout.Label ("你好"); // = GUILayout.Label ("Hello");
}
}
Error: Analytics Event: 5(Compiler*error CS1010*Newline in constant)(1): skipped because it was sent more than once in 0.10 seconds Assets/Script/Turnnel$$anonymous$$anager.cs(246,0): error CS1010: Newline in constant
(Filename: Assets/Script/Turnnel$$anonymous$$anager.cs Line: 246)
Assets/Script/Turnnel$$anonymous$$anager.cs(246,1): error CS1039: Unter$$anonymous$$ated string literal
(Filename: Assets/Script/Turnnel$$anonymous$$anager.cs Line: 246)
Assets/Script/Turnnel$$anonymous$$anager.cs(246,1): error CS1519: Unexpected symbol `' in class, struct, or interface member declaration
(Filename: Assets/Script/Turnnel$$anonymous$$anager.cs Line: 246)
Assets/Script/Turnnel$$anonymous$$anager.cs(246,1): error CS8025: Parsing error
(Filename: Assets/Script/Turnnel$$anonymous$$anager.cs Line: 246)
Answer by testure · Jun 19, 2011 at 11:29 PM
Unity doesn't support unicode strings on OSX web player at the moment, you're going to have to use different characters.
Relevant: http://feedback.unity3d.com/pages/15792-unity/suggestions/310626
Answer by areca_chen · Apr 27, 2012 at 09:14 AM
File -> save as -> Characte Coding(select 'Wstern') -> save -> select 'Overwrite file' -> "can't save file with current codepage' -> Save as Unicode -> recompile it
Your answer
Follow this Question
Related Questions
Script Errors with C# 1 Answer
Whats wrong with this script? 1 Answer
unity 3d - c# scripting problems 1 Answer
5 Errors, Need help, Unexpected symbol private etc 0 Answers
PLEASE HELP!!!! using BergZurgArcades guide having error! 5 Answers