google translation api character uses count - c#

i recently purchased the google's translation API to convert from English to French. I have used the below URL to convert the data
https://www.googleapis.com/language/translate/v2?key=[My Key]&source=en&target=fr&q=hello
after getting response i checked the Traffic Reports for my project and noticed that
"Translate API: Translation Character Count" is increaed by 10 instead of 5.even i tried with other text also and its simply doubling my input characters. Not sure if this is the way my character use should be calculated?
i will appreciate if someone from google's API team can clarify my query.
Thanks,
Ritesh

Google API is charged by the number of source characters
Link

Related

c# use non-printable characters asp.net mvc

I've to read datamatrix barcodes (vda 4902, gtin, gs1) which use non-printable chars as seperator.
The goal is to scan the barcode with intermec or honeywell hardware and send it to a c# mvc webapplication.
The printable characters are received by the webapplication, but the non-printable chars not.
I've scanned the code to the VI editor on a linux server - bere i can see the special characters. But i couldn't get it with a asp.net to work nor a c# windows form application.
So currently i don't know where to look at...
Most likely if you are passing values to another page or webservice, you are forgetting the step of properly encoding the characters you are sending. You should probably look at using something like System.Web.HttpServerUtility.HtmlEncode. This function properly converts special characters in the value you are sending to an alternate representation that gets decoded on the receiving end.
Depending on other specifics would you did not elaborate on your original question, there are many other ways to encode/escape characters for purposes like this. But the above is what I would suggest starting with if you are not clear.

QR code - standard for developer

where can I find features list for qr codes ?
I mean I can encode everything which can be represented by a string.
Example what I'm looking for:
SMS - "sms:text"
Email - "mailtio:text"
Text - "Text"
Most devices support MeCard, Hyperlinks, Phone Numbers, Email Addresses, vCards, some support Wifi Settings, and text display. Look at this question for how to use a ZXing C# API.
A MeCard is a semicolon and colon delimited set of fields and might look like this
MECARD:N:Elliott Frisch;URL:frischcode.com;
A hyperlink starts with a protocol followed by a colon, not every device supports every protocol. (e.g. http: or ftp: or sms: or mailto").
Maybe this tutorial will help you
http://www.thonky.com/qr-code-tutorial/data-encoding/

Get encoded barcode as string

I am creating a web application (ASP.NET C#) where I need the encoded barcode text.
Example: EAN13 numbers: 460650003296. The output encoded barcode is then: Y(6A65AA*KNMTQT(
And that is the value I will need to have.
I have tried to use BarCodeLib and that it´s working great to generate barcodes images but I can´t find any way to get the encoded text, I have also tried KA Barcode but with the same result.
Does anyone have any experience in this libaries and if it´s possible to get the encoded text from them, or some other suggestion how I can get the encoded value?
I don't have any experience with this library that you are using. However, my company created a web application that use different commercial library for reading and writing 1-D barcodes (including the EAN13).
We started our web application using the following 2 tutorials:
Reading Barcodes
Writing Barcodes
You can get more details from their support team using this email:
support#leadtools.com

Barcode to Product Name Converter

We are designing a mobile shopping system.
The camera on the phone will read the barcode and then we have to convert the barcode to a standard product name in order to save it to our database.
We are saving it to our database because we are connecting to a web service of local e-commerce sites to get their price about the related product. We are sending the product name to get the price from them, so that the user can see the prices, compare and buy.
We cannot send barcode number to get the data from the e-commerce sites because some sites do not have the info of the barcode number.
I have to somehow get the product name by only knowing the barcode. Google returns the result when barcode number is searched. But how am I going to parse the data? or how am I going to know which answer of google search best suits my input?
Is there a site that sells barcode and product name data match?
We are designing the system with C#
Thanks alot.
I think what you are looking for is a "UPC lookup" website. Try googling for "UPC lookup". There are lots of possibilities like upcdatabase.com.
I've had pretty good luck using https://developers.google.com/shopping-search/. I believe you can look at how the barcode scanning app Zxing uses it # Android Bar Code results from lookup into app ZXing
Instead of searching Google's general web index, search Google Shopping or amazon.

.NET library for processing HTML e-mails & stripping previous responses

Does anyone know of a .NET library that will process HTML e-mails and can be used to trim out the reply-chain? It needs to be able to accept HTML -or- text mails and then trim out everything but the actual response, removing the trail of messages that are not original content. I don't expect it to be able to handle responseswhen they're interleaved into the previous mail ("responses in-line") - that case can fail.
We have a home-built one based on SgmlReader and a series of XSL transforms, but it requires constant maintenance to deal with new e-mail clients. I'd like to find one I can buy... :)
Thanks,
Steve
This does not answer much of your question, but the W3C's Converting HTML to Other Formats has a section on converting HTML to text. I hope it helps someone develop a full answer to your question!
One free and very useful library we've used for dealing with HTML, including malformed HTML, is the HtmlAgilityPack.
There is no StripOutPreviousResponses() function, but it may help you with your home-made one.

Categories