<commit_before>/*
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2010-2012 <NAME>
==================================================================================================
*/

(function() 
{
	var hexTable = "0123456789abcdef".split("");

	/**
	 * Adds useful non-standard extensions to the `String.prototype` like {#hyphenate}, {#startsWith} and {#contains}.
	 *
	 * #require(core.Bootstrap)
	 */
	Object.addMembers("String",
	{
		/**
		 * {String} Converts a string to a base64 string 
		 */
		base64: function() {
			return btoa(this);
		},


		/**
		 * Whether the string contains the given @substring {String}.
		 */<commit_msg>Added encode/decodeUtf8 and base64 support<commit_after>/*
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2010-2012 <NAME>
==================================================================================================
*/

(function() 
{
	var hexTable = "0123456789abcdef".split("");

	/**
	 * Adds useful non-standard extensions to the `String.prototype` like {#hyphenate}, {#startsWith} and {#contains}.
	 *
	 * #require(core.Bootstrap)
	 */
	Object.addMembers("String",
	{
		/**
		 * {String} Converts a string to a base64 string 
		 */
		encodeBase64: function() {
			return btoa(this);
		},
		

		/**
		 * {String} Converts a string to a base64 string 
		 */
		decodeBase64: function() {
			return atob(this);
		},

		
		/**
		 * {String} Encodes the string as UTF-8.
		 *
		 * Via: http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html
		 */
		encodeUtf8: function() {
			return unescape(encodeURIComponent(this));
		},
		
		
		/**
		 * {String} Decodes the string from UTF-8.
		 *
		 * Via: http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html
		 */
		decodeUtf8: function() {
			return decodeURIComponent(escape(this));
		},


		/**
		 * Whether the string contains the given @substring {String}.
		 */
{'fraction_non_alphanumeric': 0.31121718377088303, 'fraction_numerical': 0.03293556085918854, 'mean_word_length': 4.002386634844869, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4073392', 'n_tokens_mistral': 717, 'n_tokens_neox': 561, 'n_words': 130}