BufferOverflowException when generating Javadoc? - exception

Has anybody ever had problems with the javadoc tool causing a java.nio.BufferOverflowException?
I'm trying to generate Javadoc for code with Japanese comments (charset MS932). I think that might be related. Does anybody know of a workaround for this problem?
Here's the stacktrace:
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:495)
at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:145)
at com.sun.tools.javac.util.DefaultFileManager.decode(DefaultFileManager.java:830)
at com.sun.tools.javac.util.DefaultFileManager.access$300(DefaultFileManager.java:76)
at com.sun.tools.javac.util.DefaultFileManager$RegularFileObject.getCharContent(DefaultFileManager.java:1353)
at com.sun.tools.javac.util.DefaultFileManager$RegularFileObject.getCharContent(DefaultFileManager.java:1252)
at com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:483)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:541)
at com.sun.tools.javadoc.JavadocTool.getRootDocImpl(JavadocTool.java:126)at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:330)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)

My guess is character encoding is not set up right.

Related

What is content in CSS before or after?

.icon-a:before { content: '\e803'; }
.icon-b:before { content: '\e96f'; }
Okay I know content can be used to render URL or quotes but what is happening in the above code?
I came across this code and it is confusing, I tried googling I can't find any.
Any help would be appreciated.
Thanks.
Quoting papiro as suggested here
Put simply, they're Unicode references. The "\e601", for example, is the hex code 0xe601. If you go here: http://unicodelookup.com/#0xe601/1 you'll see that the entry for that character is totally blank. It's in a part of the Unicode character set reserved for "private" use. Meaning icon libraries and the like can place whatever they want in those spots and not have to worry about overriding common characters like those of any of the alphabets of the world or a Chinese character, for instance.
In your case \e803 reffers to unicode character this
Hope this helps
It depends on font you are corrently using in parent element. This code is Unicode character code, which can display �. After \ code of character is entered.

Csv hebrew text not in good order

I am trying to import csv file to use the data in my php project to insert them in mysql database. The problem is that my csv file contains one column woth hebrew character. This csv converted from xls file.
The problem is that when i open the file with excel i have correct display, like that
But when i am trying to use the csv file. I have a problem of order
פרקט תלת שכבתי אלון 189x15/4 גרי ישן מעושן גימור שמן UV
Somebody know how to resolve this problem thanks!
The problem is not in my php script. My php script is all right. But the problem is that the xcel cell format not correspond when i use it in csv.
The problem is when an English word or number is mixed in with the text:
Example:
English:
“Can we improve the health of patients by giving them Aspirin?”
Hebrew:
“[Hebrew translated text] Aspirin?”
This is displayed as:
Aspirin [Hebrew translated text]?
Hopefully I explained the issue enough. It is a little confusing so if I need clarify more, please let me know.
Any help or experience is appreciated?
As an RTL language speaker, I think I can be of help.
It all depends on the text direction the UI is using. Most of the application uses LTR (Left-to-Right) for text direction by default. If you are using MySQL Workbench to see the values stored in the column, MySQL Workbench uses LTR direction as well. That's why you will see the wrong order problem when you have bi-directional (text mixed with numbers) text.
Keep in mind, that CSV is merely a UTF-8 plain text, which means the text is style-less and direction-less. You need only to set your HTML direction to RTL. See example below:
<h3>Wrong LTR Direction</h3>
<p dir="ltr">פרקט תלת שכבתי אלון 189x15/4 גרי ישן מעושן גימור שמן UV</p>
<h3>Correct RTL Direction</h3>
<p dir="rtl">פרקט תלת שכבתי אלון 189x15/4 גרי ישן מעושן גימור שמן UV</p>
Salam :)

FreeMarker cannot seem to parse HTML 5 data-* atttributes, chokes on dash

I wrote a simple custom directive, and have it pass all attributes through as regular element attributes. The syntax of the tag as follows:
<#link_to controller="unobtrusive" action="do-get" data-target="result">Do Get
Unfortunately, I get an exception:
Caused by: freemarker.core.ParseException: Encountered "-" at line 32, column 56 in unobtrusive/index.ftl.
Was expecting:
"=" ...
This is because it cannot seem to parse data-target attribute. When I change it to "data_target" with the underscore, all is fine.... but I really would need the dash: "-".
Can someone help?
Thanks,
Igor
Try this tip from the FAQ
<#link_to controller="unobtrusive" action="do-get" "data-target"="result">
I haven't tried this personally so can't vouch if it will work.
I just stuck in the same problem. <#form.textarea ... data-maxCount="100" />. It seems that freemarker misinterprets special characters in names... Freemarker FAQ
As of 2.3.22, you can use - (and . and :) as part of any name if you precede it with a \, like in <#link_to data\-target=...>. (It's not too cute, but - is already used as subtraction operator, and fixing this wouldn't backward compatible, and so must wait for a major FTL version increase.)

AntiXss.HtmlEncode vs AntiXss.GetSafeHtmlFragment

Can anyone please let me know the difference between these two?
AntiXss.HtmlEncode() vs AntiXss.GetSafeHtmlFragment()
HtmlEcode actually encodes tags:
AntiXss.HtmlEncode("<b>hello</b><script>");
//Output: <b>hello</b><script>
GetSafeHtmlFragment (AntiXss v4.0) returns HTML fragments with tags intact:
Sanitizer.GetSafeHtmlFragment("<b>hello2</b><script>")
//Output: <b>hello2</b>
Update
Many consider the latest version of Microsoft's AntiXSS library broken. I've started using HTML Sanitizer as a decent replacement.
It should also be mentioned that antixss.GetSafeHtmlFragment does encode characters too. A double quote changes to ". A plus sign turns into + etc.
I would also add that GetSafeHtmlFragment messes up your CSS, by ading x_ in front of styles, and removes your HTML entity encoding. It is a less than beautiful thing.
Herc

What is practical purpose for bidirectional override "bdo"?

Before coming here, I tried myself by googling. After I read these two links
http://www.w3schools.com/tags/tag_bdo.asp
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_bdo
I still don't understand clearly what is the practical purpose?
Thanks in advance for those who shed some light on this.
Pretty striaghtforward. If you're writing a web page using a default language, such as English, that is rendered left-to-right, and you want to include a island of text in another language, such as a quote in Hebrew, that is rendered right-to-left you can use this tag to override the base direction in which the text is written onto the page in case the bi-directional algorithm is getting it wrong. You need to make sure that the font you're using supports the appropriate character set too, of course.
http://www.w3.org/TR/html40/struct/dirlang.html
I tried the code bellow, and noticed that it is apparently obsolete for Hebrew, at least:
<!DOCTYPE html>
<html>
<body>
<p>If your browser supports bi-directional override (bdo), the next line will be written from right to left (rtl):</p>
<p>חדשות, ידיעות מהארץ והעולם - עיתון הארץ</p>
<bdo dir="rtl">חדשות, ידיעות מהארץ והעולם - עיתון הארץ</bdo>
</body>
</html>
Both seemed to output the same line, which confused me, but prompted a search that lead me to the following article:
The bidirectional ordering of text in AbiWord is done automatically,
closely following the Unicode Bidirectional Algorithm (UBA; see the
Unicode Consortium website). The Unicode character set assigns each
character certain directional properties which are then used by the
UBA to order text. Thus, Hebrew or Arabic characters will
automatically be treated as right-to-left, and English characters as
left-to-right. There are some characters that are directionally
ambiguous, and how they are treated by the UBA depends on what
characters are found in their vicinity (this includes all white space
and punctuation characters).
http://fantasai.tripod.com/qref/HTML4/structure/bdo.html
Hope it helps