Skip to content

Instantly share code, notes, and snippets.

View YakovL's full-sized avatar

Yakov Litvin YakovL

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script id="versionArea" type="text/javascript">
//<![CDATA[
var version = {title: "TiddlyWiki", major: 2, minor: 10, revision: 1, date: new Date("February 5, 2024"), extensions: {}};
//]]>
</script>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@YakovL
YakovL / creat_zip_download.php
Last active September 12, 2021 14:29 — forked from somatonic/creat_zip_download.php
create a zip file and send to browser
<?php
// this file is supposed to be in UTF-8 without BOM
function isRunningOnWindows() {
$os = php_uname('s'); //PHP_OS see https://stackoverflow.com/q/1482260/3995261
return preg_match('#win#i',$os) ? true : false;
}
function fixFilenameEncoding($name) {
// seemingly is needed on Windows only because filename encoding is not utf-8
return isRunningOnWindows() ? mb_convert_encoding($name, "windows-1251", "utf-8") : $name;
}