Jump to content

Recommended Posts

Posted

I have this problem with a mod im developing where I have a norwegian translation thing for the mod however, when I recompile it errors on the lines with norwegian characters such as 'ø' take this for example:

 


        public static int redCedarPlanksID;
public static Block redCedarPlanks;

public MedievalBlocks()
{
	this.redCedarPlanks = (new BlockMedieval(redCedarPlanksID, 0, Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("medievalCedarPlanks").setRequiresSelfNotify();			
	RegisterBlocks(new Block[]
			{
			redCedarPlanks
			});

	this.namesNorwegian("nb_NO");
}

        public void namesNorwegian(String lang)
{
	LanguageRegistry.instance().addNameForObject(redCedarPlanks, lang, "Røde Sederplanker");
        }

private void RegisterBlocks(Block ablock []) 
{
	Block ablock1[] = ablock;
	int i = ablock1.length;
	for(int j = 0; j < i; j++)
	{
		Block block = ablock1[j];
		GameRegistry.registerBlock(block);
	}	
}

 

I get this error when recompiling:


== MCP 7.23 (data: 7.23, client: 1.4.5, server: 1.4.5) ==
# found ff, ff patches, srgs, name csvs, doc csvs, param csvs, renumber csv, ast
yle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_02\bin\javac" -encoding UTF-8 -Xlint:-options -
deprecation -g -sourc...' failed : 1

== ERRORS FOUND ==

src\common\thedecopack\medieval\blocks\MedievalBlocks.java:134: error: unmappabl
e character for encoding UTF-8
                LanguageRegistry.instance().addNameForObject(redCedarPlanks, lan
g, "R?de Sederplanker");

     ^

 

Posted

Go here: http://www.fileformat.info/info/charset/UTF-8/list.htm

 

Look up for the character which throws an error, then look in the second row which looks like this: LATIN CAPITAL LETTER O WITH STROKE (U+00D8)

Take the code in the brackets (after the U+; here 00D8) and replace the character with this: \u00D8 - The code you have comes after the \u

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.