[MDSAL-203] Unsupported UTF-8 code. Created: 24/Oct/16  Updated: 09/Mar/18  Resolved: 29/Oct/16

Status: Verified
Project: mdsal
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Qing Dong Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


Attachments: Java Source File TestStatusOutputBuilder.java     PNG File vs.png    
External issue ID: 7013

 Description   

When compile the controller project on Windows (7/10), an error occurs when compile the JAVA code such as 0..4294967295 that generated by yang-tools. It may because the ".." is not recognized in Windows.

The error message is:
[ERROR] C:\Users\sweet\git\controller\benchmark\api\target\generated-sources\mdsal-binding\org\opendaylight\yang\gen\v1\urn\opendaylight\params\xml\ns\yang\rpcbenchmark\rev150702\TestStatusOutputBuilder.java:74: 错误: 编码UTF-8的不可映射字符
[ERROR] throw new IllegalArgumentException(String.format("Invalid range: %s, expected: [[0?E4294967295]].", value));
[ERROR] ^

The solution may be changing the ".." to a real two point "." .



 Comments   
Comment by Peter Kajsa [ 25/Oct/16 ]

It seems like binding-generator issue, so moved to md-sal.

Comment by Robert Varga [ 26/Oct/16 ]

I am not sure this is actually our fault. The string is generated from Guava, which I assume is used all over the place.

There do not seem to be any problems with its encoding on systems which are configured with native UTF-8.

Can you upload a binary of TestStatusOutputBuilder, please?

Also can you detail your locale settings (as they may provide a clue as to what is going on)?

Comment by Robert Varga [ 26/Oct/16 ]

I strongly suspect default mapping issues, hinted at: http://stackoverflow.com/questions/23677855/android-studio-unmappable-character-for-encoding-utf-8

Comment by Qing Dong [ 26/Oct/16 ]

Attachment TestStatusOutputBuilder.java has been added with description: In line 74.

Comment by Qing Dong [ 26/Oct/16 ]

I opened the file in two softwares, the showing word is different.

Comment by Qing Dong [ 26/Oct/16 ]

Attachment vs.png has been added with description: Behavior in different software

Comment by Qing Dong [ 26/Oct/16 ]

My OS is Windows 10 Chinese Simp. I set the encode of the text editor in Eclipse to UTF-8.

Comment by Robert Varga [ 27/Oct/16 ]

So the codegen emits output in whatever the local setting is (simplified Chinese in this case), but our toolkit expects it to be in UTF-8.

master: https://git.opendaylight.org/gerrit/47661

Comment by Robert Varga [ 27/Oct/16 ]

boron: https://git.opendaylight.org/gerrit/47663

Comment by Qing Dong [ 28/Oct/16 ]

It works fine now! Thank you!

Comment by Robert Varga [ 29/Oct/16 ]

Thanks for confirming

Generated at Wed Feb 07 20:09:01 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.