Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Illegal character 8204 error

For some reason, after rebuilding my project I get an illegal character error but nothing within my code gets underlined in red. Can someone please tell me what is wrong and how to resolve it?

Error

illegal character: \8204

WCBankActivity.java

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;

public class WCBankActivity extends ActionBarActivity {

    public final static String EXTRA_MESSAGE = "Station_key";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_wc_bank);

        if (savedInstanceState == null) {
            Intent intent = getIntent();
            String station = intent.getStringExtra(WCBankActivity.EXTRA_MESSAGE);

            FragmentWCBank newFragment = new FragmentWCBank();
            FragmentTransaction transaction = this.getSupportFragmentManager().beginTransaction();‌
            transaction.replace(R.id.detail_container, newFragment);
            transaction.commit();
        }
    }
}

1

like image 294
wbk727 Avatar asked Jun 08 '15 20:06

wbk727


People also ask

How do you fix an illegal character?

The “illegal character” error occurs in the compilation phase, so it's quite easy to detect. The next example shows us how it works. Ideally, to fix this problem, the only thing to do is save the file as UTF-8 without BOM encoding. After that, the problem is solved.

What is an illegal character?

Illegal characters are letters, numbers, punctuation marks, and similar symbols not allowed or prohibited by a computer program or syntax. The exact nature of these characters can vary, depending on the program being used and the way in which those characters are used.


1 Answers

Try changing your encoding, see the image:

enter image description here

like image 125
Jorgesys Avatar answered Sep 20 '22 06:09

Jorgesys