当前位置: 首页>>代码示例>>PHP>>正文


PHP cp1252_to_utf8函数代码示例

本文整理汇总了PHP中cp1252_to_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP cp1252_to_utf8函数的具体用法?PHP cp1252_to_utf8怎么用?PHP cp1252_to_utf8使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cp1252_to_utf8函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cp1252_to_utf8

&pl=<?php 
echo $part_finder->product_line;
?>
&make=<?php 
echo $makes[$x];
?>
&unit='><?php 
echo $part->part_number;
?>
</a></div>
				<div class='long1'><?php 
echo cp1252_to_utf8($part->description);
?>
</div>
				<div class='med'><?php 
echo cp1252_to_utf8($part->notes);
?>
</div>
				<?  
				$make = new Make($makes[$x]);
				$make_name = $make->make;
				$units =  $part->getUnitsContainingPart($makes[$x]);
				$unitsUpperBound = count($units) - 1;
				unset($unitList);
				for ($y=0; $y <= $unitsUpperBound; $y++) {
					$brief_unit = new UnitBrief($units[$y]);
					if ($y < $unitsUpperBound) {
						$unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>, ";
					} else {
						$unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>";
					}
开发者ID:sonnaxindustries,项目名称:sonnax_php,代码行数:31,代码来源:results_ts_BAK_2008-01-23.php

示例2: urlencode

						&id=<?php 
echo $part->id;
?>
&pl=<?php 
echo $part_finder->product_line;
?>
&rdir=<?php 
echo urlencode($rd);
?>
'><?php 
echo $part->part_number;
?>
</a>
			</div>
			<div class='long1' style='width:380px;'><?php 
echo cp1252_to_utf8($part->description);
?>
</div>
			<div class='short'>&nbsp;</div>
			<div class='line'></div>
			<?
		}
		?>
		<div class="cleaner"></div>
		</div>
		<div class="cleaner"></div>
		<?
	} else {
		// no parts in the stack
		?>
		<div class="cleaner"></div>
开发者ID:sonnaxindustries,项目名称:sonnax_php,代码行数:31,代码来源:results_10_hptc_BAK_2008-08-08.php

示例3: ConvertToUTF_8

function ConvertToUTF_8($encoding, $charset, $body)
{
    $charset = strtolower($charset);
    $encoding = strtolower($encoding);
    switch ($charset) {
        case "iso-8859-1":
            $body = utf8_encode($body);
            break;
        case "iso-2022-jp":
            $body = iconv("ISO-2022-JP//TRANSLIT", "UTF-8", $body);
            break;
        case $charset == "windows-1252" || $charset == "cp-1252" || $charset == "cp 1252":
            $body = cp1252_to_utf8($body);
            break;
        case $charset == "windows-1256" || $charset == "cp-1256" || $charset == "cp 1256":
            $body = iconv("Windows-1256//TRANSLIT", "UTF-8", $body);
            break;
        case 'koi8-r':
            $body = iconv("koi8-r//TRANSLIT", "UTF-8", $body);
            break;
        case 'iso-8859-2':
            $body = iconv("iso-8859-2//TRANSLIT", "UTF-8", $body);
            break;
    }
    return $body;
}
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:26,代码来源:postie-functions.php

示例4: tfu_text

function tfu_text($file)
{
    if (is_writable($file)) {
        echo '&writeable=true';
    } else {
        echo '&writeable=false';
    }
    echo '&data=';
    $enc = 'UTF-8';
    $format = 'UNIX';
    $fp = fopen($file, 'rb');
    $content = fread($fp, filesize($file));
    // we replace \r with nothing
    $content_new = str_replace("\r", "", $content);
    if ($content_new != $content) {
        $format = 'DOS';
    }
    if (!tfu_seems_utf8($content_new)) {
        $content_new = cp1252_to_utf8($content_new);
        $enc = 'ANSI';
    }
    echo urlencode($content_new);
    echo '&encoding=' . $enc;
    echo '&format=' . $format;
    fclose($fp);
}
开发者ID:jnvilo,项目名称:tomasinasanctuary.org,代码行数:26,代码来源:tfu_helper.php

示例5: cp1252_to_utf8

?>
</div>
							<div class='longest'><?php 
echo cp1252_to_utf8($arr_data["unit_components.description"][$x]);
?>
</div>
							<div class='longest'><?php 
echo $arr_data["unit_components.torque_fuse_options"][$x];
?>
</div>
							<div class='longest'><?php 
echo $arr_data["unit_components.pts_series"][$x];
?>
</div>
							<div class='longest'><?php 
echo cp1252_to_utf8($arr_data["unit_components.notes"][$x]);
?>
</div>
							<div class="line"></div>
						<?}
					} else {
						// no parts in the stack
						?>
						<div class="cleaner"></div>
						<div class='long1' style='width:760px;text-align:center;font-weight:bold;font-size:16px;'><?php 
echo $part_finder->search_message;
?>
</div>
						<?
					}
					?>					
开发者ID:sonnaxindustries,项目名称:sonnax_php,代码行数:31,代码来源:results_9_pts.php

示例6: header

     header("Content-Disposition: inline; filename={$filename}.{$random}.{$ext}");
     echo $data;
     break;
 case "htm":
 case "html":
     $data = $_GET["id"] == "" ? $data : $generator->PrepareHtml($data);
     $data = $_GET["bookmark"] == "" ? $data : '<a name="bookmark">' . $data . '</a>';
     $len = strlen($data);
     header("Content-type: text/html");
     header("Content-length: {$len}");
     header("Content-Disposition: inline; filename={$filename}.{$random}.{$ext}");
     echo $data;
     break;
 case "xml":
     if ($_GET["expand"] != "") {
         $data = cp1252_to_utf8($generator->GenerateXml($data));
         $len = strlen($data);
     }
     header("Content-type: text/xml; charset=utf-8");
     header("Content-length: {$len}");
     header("Content-Disposition: attachment; filename={$filename}.{$random}.xml");
     echo $data;
     break;
 case "odt":
     if ($_GET["expand"] != "") {
         $data = $generator->GenerateOdt($data);
         $len = strlen($data);
     }
     header("Content-type: application/odt; charset=utf-8");
     header("Content-length: {$len}");
     header("Content-Disposition: attachment; filename={$filename}.odt");
开发者ID:ctcit,项目名称:newsletter,代码行数:31,代码来源:generate.php

示例7: elseif

		<?
	}
}
?>

<p><strong>Part Number:</strong>&nbsp;<?=$Part->part_number?></p>
<?if ($product_line_id == 9) {
	if (strlen($Unit_Component->arrayList["unit_components.description"][0]) > 0){?>
	<p><strong>Description:</strong>&nbsp;<?=cp1252_to_utf8($Unit_Component->arrayList["unit_components.description"][0])?></p>
	<?}
	if (strlen($Unit_Component->arrayList["unit_components.notes"][0]) > 0){?>
	<p><strong>Notes:</strong>&nbsp;<?=cp1252_to_utf8($Unit_Component->arrayList["unit_components.notes"][0])?></p>
	<?}
} else {?>
<p><!-- description1 --><?=cp1252_to_utf8($Part->description)?></p>
<p><!-- description2 --><?=cp1252_to_utf8($Part->notes)?></p>
<?}?>

<?php
// Part Summay and Instruction go here for certain PLs
if ($product_line_id == "3" || $product_line_id == 3 || $product_line_id == "12" || $product_line_id == 12 || $product_line_id == "14" || $product_line_id == 14) {?>	
<!-- Show ONLY for TS SC and TT -->
	<h4 style="text-align:center;">
	<?if (file_exists($global_announcement_directory_abs.$Part->announcement) && (strlen($Part->announcement) > 0)) {?>
	<a href="<?=$global_announcement_directory_rel.$Part->announcement?>">Part Summary</a><img src="images/spacer.jpg" width="30" height="1" alt="spacer">
	<?}?>
	<?if (file_exists($global_instructions_directory_abs.$Part->instructions) && (strlen($Part->instructions) > 0)) {?>
	<a href="<?=$global_instructions_directory_rel.$Part->instructions?>">Instructions</a><img src="images/spacer.jpg" width="30" height="1" alt="spacer">
	<?}?>
	</h4>
<?} elseif ($product_line_id == "2" || $product_line_id == 2) {?>	
开发者ID:sonnaxindustries,项目名称:sonnax_php,代码行数:31,代码来源:part_summary_BAK_2009-04-17.php

示例8: fopen

         echo "&writeable=true";
     } else {
         echo "&writeable=false";
     }
     echo "&data=";
     $enc = "UTF-8";
     $format = "UNIX";
     $fp = fopen($file, "rb");
     $content = fread($fp, filesize($file));
     // we replace \r with nothing
     $content_new = str_replace("\r", "", $content);
     if ($content_new != $content) {
         $format = "DOS";
     }
     if (!seems_utf8($content_new)) {
         $content_new = cp1252_to_utf8($content_new);
         $enc = "ANSI";
     }
     print $content_new;
     echo "&encoding=" . $enc;
     echo "&format=" . $format;
     fclose($fp);
 } else {
     if ($action == "savetext") {
         // save a textfile
         $content = urldecode($_POST['data']);
         if ($_POST['encoding'] == "ANSI") {
             $content = utf8_to_cp1252($content);
         }
         if ($_POST['format'] == "DOS") {
             $content = preg_replace('/\\r\\n|\\r|\\n/', chr(13) . chr(10), $content);
开发者ID:jmp0207,项目名称:w3studiocms,代码行数:31,代码来源:tfu_file.php


注:本文中的cp1252_to_utf8函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。