Closed GoogleCodeExporter closed 8 years ago
Try to set the encoding according to your system.
myDoc.encoding(Encoding.UTF_8);
or
I think you can pass a string:
myDoc.encoding("whatever string");
cheers
Leonardo Correa
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 11:01
Hi Leonardo,
I tried both of the encoding procedures the first one didnt work and the second
one i.e, myDoc.encoding("&");,had given me total xml document of the myDoc.
What could be the problem? Kindly get back at the earliest.
Thanks,
Phani.
Original comment by phanindr...@gmail.com
on 27 Oct 2011 at 12:00
I think you have to send the & encoded. I will give a try. i will be back in a
minute...
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 12:03
Thank you so much Leonardo. I will be waiting for your reply.
Original comment by phanindr...@gmail.com
on 27 Oct 2011 at 12:08
This is it:
@Test
public void testTst() {
IDocument myDoc = new Document2004();
myDoc.addEle(Paragraph.with("aaa &").create());
String myWord = myDoc.getContent();
TestUtils.createLocalDoc(myDoc.getContent());
}
I will add to the project page that special characters need to be encoded - not
change the encoding of the document.
cheers
Leonardo
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 12:11
You are lucky man I can't sleep, you ended up getting a on-line support on
java2word first...
I updated the project page:
http://code.google.com/p/java2word/#All-in-one_Example_-_See_everything_you_can_
do_with_Java2word
Updated the unit test all-in-one
and committed the unit test code
cheers
Leonardo
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 12:20
Thank you so much Leonardo for your useful help but there are some characters
like ®,¥,... like some currency symbols which are not working even though we
use the escape sequence like what we used for '&' i.e, '&' .Can you please make
me aware of the procedure in which I can proceed. I know the escape sequences
for all the other special characters. I proceeded the same way as you suggested
but ended up in a document which could not open for me. I dont want your normal
work got disturbed by this so kindly suggest me the way in which I can proceed
or if you come up with sample code as aboove it would be a great help for me.
Thanks,
Phani
Original comment by phanindr...@gmail.com
on 27 Oct 2011 at 12:24
I think if we find a list of stuff to scape, j2w can look up and do the
replacement.
don't know... maybe a encoding reference list on google...
I gotta go now but it will work if you find out which character is breaking or
not getting encoded properly
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 12:33
¥ can you please try for this for me? the escape sequence is "¥" please.
Thanks,
Phani.
Original comment by phanindr...@gmail.com
on 27 Oct 2011 at 12:43
myDoc.addEle(Paragraph.with("¥").create());
The trick is: get the decimal number (165), add &#[number here]; and you are
done:
This list is good, lets keep it handy:
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Original comment by leonardo...@gmail.com
on 27 Oct 2011 at 1:02
Thank you so much Leonardo for your great help and really helpful Java2Word API.
Thanks,
Phani.
Original comment by phanindr...@gmail.com
on 27 Oct 2011 at 1:06
[deleted comment]
wiki for encoding is now:
http://code.google.com/p/java2word/wiki/EncodingTipsandTricks
Original comment by leonardo...@gmail.com
on 17 Jan 2012 at 12:34
Hi Leonardo thanks a lot for the fix..
Regards
Phanindra
Original comment by phanindr...@gmail.com
on 8 Oct 2012 at 12:34
Hey Thanks for the tips but is there any way I can insert "<" and ">" with this
API.
I would appreciate your reply.
Thanks
Original comment by vrindama...@gmail.com
on 13 Jun 2013 at 9:51
Original issue reported on code.google.com by
phanindr...@gmail.com
on 27 Oct 2011 at 10:59