Internationalization of text data using Apache POI for Excel Import export - internationalization

I work in Java Technology and a beginner in Apache POI. I am implementing Excel Import Export using Apache POI API and data in mysql database. I have to read and write the localized data Like Chinese characters and other characters that are UTF-8 / UTF-16 encoded. For eg, the Titles in the Excel will be localized but data can be in English.
I want to know, if POI provides API to write into the Excel that takes encoding as parameter or some other way. Pls suggest.
The API that i know is : workbook.write(fileoutputstream). Please suggest if there is a way to write other encoding characters.
Thanks in advance,
Pallavi

Apache POI works with Java Strings. Java Strings are unicode - see the official Java Strings and Bytes tutorial for more if this is all new to you.
As long as you give POI a valid Java string for your character, it will save that into the file for you. However, you do need to ensure you get the strings into your program correctly!
POI has loads of unit tests which verify it handles unicode characters just fine, take a look at TestBugs for quite a few

Related

Weka UI language configuration error while reading file

in attempts to implement Machine learning into my project, i used WEKA. And to train and test it, weka process collection of data which is in Russian Language. But in process of reading it shows unreadible ('ЧÑ, о Ñ') characters. I understand that this is due to language configuration error, but i cant find a solution. Any help is apperciated
WEKA UI screenshot
i gave java 1.8, weka 3.8.
my dataset is like: "Российский ситком (ситуационная комедия) «Интерны», совмещенная адаптация «Клиники» и «Доктора Хауса»"
my folder is like:
-kino1tr:
-good
-bad
-neutral
i did stupid mistake. While loading data, there charSet field to specify language configuration. Thus, stating UTF-8 in charset resolves the issue

ANSI Message format validator

We know ANSI is the one of the standard and format for transfer the financial and billing information between organisation, in our terms application, ie integration purpose, while developing the ANSI format integrations we need some message format validator software that could be helpful to identify the segments required fields and match the segments and values between templates and actual message that we are constructing.
I have one validator for HL7 message like 7edit, like this do we have any ANSI message validator that will integrate all like ANSI, UB04 message elements.
Thanks in advance.
Your best bet might be to use open-source Java libraries and create a small app yourself.
Here are some libraries:
EDIReader http://berryworkssoftware.net/index.php?option=com_content&task=view&id=13&Itemid=27
BOTS http://bots.sourceforge.net/en/index.shtml
SMOOKS http://www.smooks.org/

UTF-8 encoding Google Apps Email Settings API

I've been using Google Apps Email Settings API for a while but I came to a problem when I tried to insert aliases, signatures or any information with "ñ" or "Ñ". It adds garbage instead of those characters and it doesn't seem to respect the charset specified (utf-8) in the HTTP header nor the XML character encoding.
I have tried via my own python code and also using OAuth Playground[1] but it's been impossible to properly add the mentioned characters.
¿Any idea/suggestion?
Thanks in advance.
EDIT: It seems that the problem is not in the request but in the response. I have encoded it successfully in my code but it should be also fixed in OAuth Playground.
[1] https://developers.google.com/oauthplayground/
I have succesfully called Google API client methods using UTF8-encoded strings, so it is definitely an issue with your Python setup.
I would workaround this issue sending Unicode strings instead of UTF-8 encoded:
u'literal string' # This is unicode
'encoded utf-8 string'.decode('utf-8') # This is unicode
EDIT: Re-reading your answer it seems that you are making raw HTTP calls with hand-made XML documents. I can't understand why. If it's the way you want to go, take a look into Emails Settings API client code to learn how to build the XML documents.

How to read excel file tibco activities?

I have a requirement to read excel file using tibco palettes.Can any body please throw some lights regarding this. I am basically new to this tibco BW. Please tell me what steps should I follow?
I am assuming you are not referring to CSV files, for which you could use the File Read and Parse activities of BW.
If you want to parse or render a multi-worksheet workbook, you can try publicly available API's such as Apache's POI or commercial API's such as from Aspose to cut your own Java based solution. Then you can use the Java Code or general Java activities to embed and use that code.
And then there's another ready-to-use option available from us: an Excel Plugin for TIBCO BusinessWorks, if you wish to leverage all built-in features of BW (XPath mapping, etc) when parsing or rendering your Excel.
Edit 1:
As per your comment, you can also try the following steps, if you are looking for a more homegrown solution.
Based on one of the (public/commercial) libraries above you can write generic Java Code to parse each cell of each row of each sheet of the workbook. Output should be an XML string. Then create an XSD to match your output. It is at your discretion, which information of the cell you want to read from the workbook - you already are aware of the complexity of the API, I am sure.
Create a BW (sub)process that calls your code from a Java activity, use Parse XML to parse your XML string result into you XSD structure. Configure the End activity to use your XSD and map (copy) your Parse XML result into the End activity.
Then wrap this subprocess into a Custom Activity (General Activities Palette). Create a Custom Palette and now you can re-use what you did in many other BW projects. The path to the custom palettes can be found in TIBCO Designer - Edit- Preferences - General - User Directories
If you add Error Output schemas, you will also get typed error outputs from that custom activity.
HTH,
Hendrik

How to test webservice for unicode handling

Are there test tools available to test if a webservice can handle unicode utf-8 encoded posts? How do I generate utf-8 encoded data?
The sad-but-true answer is that there is no way to know what encoding some program expects if they don't either document it, or provide encoding metadata in whatever protocol you're using.
As for generating utf-8, well, that depends on what programming language you're using.

Resources