本文整理汇总了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>";
}
示例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'> </div>
<div class='line'></div>
<?
}
?>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
<?
} else {
// no parts in the stack
?>
<div class="cleaner"></div>
示例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;
}
示例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);
}
示例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>
<?
}
?>
示例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");
示例7: elseif
<?
}
}
?>
<p><strong>Part Number:</strong> <?=$Part->part_number?></p>
<?if ($product_line_id == 9) {
if (strlen($Unit_Component->arrayList["unit_components.description"][0]) > 0){?>
<p><strong>Description:</strong> <?=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> <?=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) {?>
示例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);