含有中文路径的视频在线播放处理

访问含有中文路径的视频,一般都是进行urlencode访问。

但是在实际项目中出现访问 urlencode中文路径 返回403的情况。

这个时候需要urlencode2次,就可以解决。

<!-- lang: php -->
<?php echo urlencode(urlencode($rs2['nurl']));?>

此方法在apache服务器测试通过。

================= 2014-01-13 更新 实际情况中可能文件夹也是中文的,直接2次urlencode后访问会出现404的错误,访问不了资源。 经测试,应该是 ”/“也被转义的原因。

所以需要处理下整个url。代码如下:

<!-- lang: php -->
function pUrl($url){
$urlinfo = parse_url($url);
$pathArray = explode("/",$urlinfo['path']);
foreach($pathArray as $key=>$value){
	$pathArray[$key] = urlencode(urlencode($value));
}
$urlinfo['path'] = implode("/",$pathArray);
return $urlinfo['scheme'].'://'.$urlinfo['host'].$urlinfo['path'];
}

转载于:https://my.oschina.net/zhong85/blog/192494

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Carlos Oliveira, "Options and Derivatives Programming in C++" 2016 | ISBN-10: 1484218132 | 260 pages | PDF | 7 MB This is a hands-on book for programmers wanting to learn how C++ is used in the development of solutions for options and derivatives trading in the financial industry. As an important part of the financial industry, options and derivatives trading has become increasingly sophisticated. Advanced trading techniques using financial derivatives have been used at banks, hedge funds, and pension funds. Because of stringent performance characteristics, most of these trading systems are developed using C++ as the main implementation language. Options and Derivatives Programming in C++ covers features that are frequently used to write financial software for options and derivatives, including the STL, templates, functional programming, and support for numerical libraries. New features introduced in the C++11 and C++14 standard are also covered: lambda functions, automatic type detection, custom literals, and improved initialization strategies for C++ objects. Readers will enjoy the how-to examples covering all the major tools and concepts used to build working solutions for quantitative finance. It includes advanced C++ concepts as well as the basic building libraries used by modern C++ developers, such as the STL and Boost, while also leveraging knowledge of object-oriented and template-based programming. Options and Derivatives Programming in C++ provides a great value for readers who are trying to use their current programming knowledge in order to become proficient in the style of programming used in large banks, hedge funds, and other investment institutions. The topics covered in the book are introduced in a logical and structured way and even novice programmers will be able to absorb the most important topics and competencies. What You Will Learn Grasp the fundamental problems in options and derivatives trading Converse intelligently about credit default swaps, Forex derivatives, and more Implement valuation models and trading strategies Build pricing algorithms around the Black-Sholes Model, and also using the Binomial and Differential Equations methods Run quantitative finance algorithms using linear algebra techniques Recognize and apply the most common design patterns used in options trading Save time by using the latest C++ features such as the STL and the Boost libraries Who This Book Is For Options and Derivatives Programming in C++ is for professional developers who have some experience with the C++ language and would like to leverage that knowledge into financial software development. This book is written with the goal of reaching readers who need a concise, algorithms-based book, providing basic information through well-targeted examples and ready to use solutions. Readers will be able to directly apply the concepts and sample code to some of the most common problems faced in the analysis of options and derivative contracts.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值