Convert javascript from image to base64 encoded String and base64string

Source: Internet
Author: User

Convert javascript from image to base64 encoded String and base64string

Recently, we need to open the sharing method of the app to webview, which involves sharing images. If we transfer an image connection, we will retrieve another image file in the background, which will affect the speed, I chose webview to pass the image to the local application in base64 encoding mode. The following is the implementation reference code:

<!DOCTYPE html> 

How can I convert the url of a known image to base64 javascript jQuery? Do not use php because of the offline mode?

Haha, I have met the js base64 function. You can get the address by yourself.
Http deletion: // baid Chinese. us/g2ZA

Urlencode encoding, found to contain Chinese characters, using javascript-base64 encoding found that can only support asc11 encoding how should I escape

UTF-8 + base64 use base64 to encode the Chinese information using the special tags of Information segmentation with UTF-8 and then use any encoding combination.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.