Differences in the ISO-2022-JP encoding between browsers
Posted: April 3, 2013 Filed under: Uncategorized Leave a comment »There are differences in the ISO-2022-JP encoding between browsers, which are explained here. Character encodings based on ISO 2022 are much more complex than many other encodings, such as Shift_JIS and UTF-8. That’s because ISO 2022 uses escape sequences that shift the converter into other character sets, among other things, and many character encodings are designed to work with ISO 2022. ISO-2022-JP is one encoding that supports a subset of these character sets, such as ASCII and a few Japanese character sets.
Test URL: http://upokecenter.com/projects/iso2022.htm
Browsers tested: Safari 5.1.7, Internet Explorer 10, Opera 12, Google Chrome 26, and Firefox 19.0.2.
NOTE: Chrome and Safari were identical, probably because they both use Webkit, so Webkit is used below instead of either. “All browsers” means all browsers that were tested. The test occurred on April 3, 2013. I prefer not to draw conclusions on the results.
Shift to multibyte, character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%24%40VP%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #x5d84 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #x5d84 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x5d84 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x5d84 #x78 #x78 #x78
Shift to multibyte then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%24%40%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #xfffd #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x78 #x78 #x78
Shift to multibyte at end
data:text/html;charset=iso-2022-jp,xxx%1b%24%40
- Opera: #x78 #x78 #x78
- Webkit: #x78 #x78 #x78
- Firefox: #x78 #x78 #x78
- IE: #x78 #x78 #x78
Shift to ASCII at end
data:text/html;charset=iso-2022-jp,xxx%1b%28%4A
- Opera: #x78 #x78 #x78
- Webkit: #x78 #x78 #x78
- Firefox: #x78 #x78 #x78
- IE: #x78 #x78 #x78
Unrecognized escape at end
data:text/html;charset=iso-2022-jp,xxx%1b%28%7E
- Opera: #x78 #x78 #x78 #xfffd #x7e
- Webkit: #x78 #x78 #x78 #xfffd #x28 #x7e
- Firefox: #x78 #x78 #x78 #x1b #x28 #x7e
- IE: #x78 #x78 #x78 #x1b #x28 #x7e
Shift to C1 then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%40%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x40 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x40 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x40 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x40 #x78 #x78 #x78
Shift to private control then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%30%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x30 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x30 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x30 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x30 #x78 #x78 #x78
Private escape sequence then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%22%22%22%22%22%22%30%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x22 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x22 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x22 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x22 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
Private escape sequence then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%28%22%22%22%22%22%30%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x28 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x28 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x28 #x22 #x22 #x22 #x22 #x22 #x30 #x78 #x78 #x78
Shift to multibyte, then private escape, then character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%24%40%28%22%22%22%22%22%30VP%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #x2502 #x25a1 #x25a1 #x6170 #xfffd #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #x2502 #x25a1 #x25a1 #x6170 #xfffd #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x2502 #x25a1 #x25a1 #x6170 #xfffd #x28 #x4a #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x2502 #x25a1 #x25a1 #x6170 #x30fb #x30fb #x30fb
Shift to multibyte, then illegal escape, then character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%24%40%1b%0aVP%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #xa #x56 #x50 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #xa #x56 #x50 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #xa #x5d84 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x75 #xff94 #x30fb #x30fb #x30fb
Shift to multibyte, then illegal escape, then character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%24%40%1b%0bVP%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #xb #x56 #x50 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #xfffd #x5d84 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #xb #x5d84 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x76 #x75 #x30fb #x30fb #x30fb
Illegal escape, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%02%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x2 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x2 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x2 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x2 #x78 #x78 #x78
Shift to C1, then character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%40y%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x40 #x79 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x40 #x79 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x40 #x79 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x40 #x79 #x78 #x78 #x78
Shift to private control, then character, then shift to ASCII
data:text/html;charset=iso-2022-jp,xxx%1b%30yyyy%1b%28%4Axxx
- Opera: #x78 #x78 #x78 #xfffd #x30 #x79 #x79 #x79 #x79 #x78 #x78 #x78
- Webkit: #x78 #x78 #x78 #xfffd #x30 #x79 #x79 #x79 #x79 #x78 #x78 #x78
- Firefox: #x78 #x78 #x78 #x1b #x30 #x79 #x79 #x79 #x79 #x78 #x78 #x78
- IE: #x78 #x78 #x78 #x1b #x30 #x79 #x79 #x79 #x79 #x78 #x78 #x78
Shift to private control then shift to multibyte
data:text/html;charset=iso-2022-jp,xxx%1b%30%1b%24%40VP
- Opera: #x78 #x78 #x78 #xfffd #x30 #x5d84
- Webkit: #x78 #x78 #x78 #xfffd #x30 #x5d84
- Firefox: #x78 #x78 #x78 #x1b #x30 #x5d84
- IE: #x78 #x78 #x78 #x1b #x30 #x5d84
Shift to private control, then character, then shift to multibyte
data:text/html;charset=iso-2022-jp,xxx%1b%30yyyy%1b%24%40VP
- Opera: #x78 #x78 #x78 #xfffd #x30 #x79 #x79 #x79 #x79 #x5d84
- Webkit: #x78 #x78 #x78 #xfffd #x30 #x79 #x79 #x79 #x79 #x5d84
- Firefox: #x78 #x78 #x78 #x1b #x30 #x79 #x79 #x79 #x79 #x5d84
- IE: #x78 #x78 #x78 #x1b #x30 #x79 #x79 #x79 #x79 #x5d84
Source code for iso2022.php, used by the test:
<?php
// In the public domain.
// http://creativecommons.org/publicdomain/zero/1.0/
header("Content-Type: text/html; charset=iso-2022-jp");
$content=substr($_GET['content'],0,32);
function tohex($s){
if($s=="0")return 0;
if($s=="1")return 1;
if($s=="2")return 2;
if($s=="3")return 3;
if($s=="4")return 4;
if($s=="5")return 5;
if($s=="6")return 6;
if($s=="7")return 7;
if($s=="8")return 8;
if($s=="9")return 9;
if($s=="a" || $s=="A")return 10;
if($s=="b" || $s=="B")return 11;
if($s=="c" || $s=="C")return 12;
if($s=="d" || $s=="D")return 13;
if($s=="e" || $s=="E")return 14;
if($s=="f" || $s=="F")return 15;
return -1;
}
echo("
<script>document.addEventListener('DOMContentLoaded',function(e){
var s=document.getElementById('result').innerHTML
for(var i=0;i<s.length;i++){
document.getElementById('unicode').innerHTML+='#x'+s.charCodeAt(i).toString(16)+' '
}
},false)</script><p id='unicode'></p><p id='result'>");
for($i=0;$i<strlen($content);$i++){
if($content[$i]=="@"){
$hex=tohex($content[$i+1]);
$hex*=16;
$hex+=tohex($content[$i+2]);
if($hex<=0||$hex>=256||$hex==0x3c)die();
$i+=2;
echo(Chr($hex));
} else {
if(Ord($content[$i])==0x3c)die();
echo($content[$i]);
}
}
?>
Colored Boxes Live Wallpaper for Android
Posted: February 9, 2013 Filed under: Uncategorized Leave a comment »This is my first Android app, and I hope you like it. Learn more at:
http://upokecenter.com/projects/colorwallpaperNew Donation Link
Posted: November 25, 2012 Filed under: Uncategorized Leave a comment »I’ve set up a new donation page today for this site. Donate now.
http://www.gofundme.com/1kcsek
Color Formulas
Posted: November 15, 2012 Filed under: Uncategorized Leave a comment »This page will list common formulas for changing RGB colors (red-green-blue colors). In the sections below we will work with color components that range from 0 through 255. This page may be expanded from time to time.
Read the rest of this entry »Pokémon World Tournament Teams
Posted: October 27, 2012 Filed under: Uncategorized Leave a comment »This is a list of the four Pokémon teams from the recently offered Pokémon World Tournament distribution. This page may be updated with other teams from other distributions.
Each team is in Pokémon Online format.
Read the rest of this entry »A List of Generation 4 Moves No Longer Physical or Special
Posted: October 15, 2012 Filed under: Pokemon Leave a comment »Starting in Pokemon Diamond and Pearl, moves were classified as physical or special differently; they now depend on the move itself rather than its type. However, most attacks that were physical in previous versions remain physical, and most special attacks remained special. Exceptions are listed below.
- Was Physical, Now Special: In the third generation, the following special attacks used to be physical attacks because their type was Bug, Fighting, Flying, Ghost, Ground, Normal, Poison, Rock, or Steel: Razor Wind (NORMAL), Gust (FLYING), SonicBoom (NORMAL), Acid (POISON), Hyper Beam (NORMAL), Night Shade (GHOST), Smog (POISON), Sludge (POISON), Swift (NORMAL), Tri Attack (NORMAL), Snore (NORMAL), Aeroblast (FLYING), Sludge Bomb (POISON), Mud-Slap (GROUND), Hidden Power (NORMAL), AncientPower (ROCK), Shadow Ball (GHOST), Uproar (NORMAL), Spit Up (NORMAL), Hyper Voice (NORMAL), Weather Ball (NORMAL), Air Cutter (FLYING), Silver Wind (BUG), Signal Beam (BUG), Mud Shot (GROUND), Doom Desire (STEEL). In addition, the following moves are special despite having physical attack types: Trump Card (NORMAL), Wring Out (NORMAL), Aura Sphere (FIGHTING), Air Slash (FLYING), Bug Buzz (BUG), Power Gem (ROCK), Vacuum Wave (FIGHTING), Focus Blast (FIGHTING), Earth Power (GROUND), Mud Bomb (GROUND), Mirror Shot (STEEL), Flash Cannon (STEEL), Chatter (FLYING), Judgment (NORMAL), Ominous Wind (GHOST)
- Was Special, Now Physical: In the third generation, the following physical attacks used to be special attacks because their type was Dark, Dragon, Electric, Fire, Grass, Ice, Psychic, or Water: Fire Punch (FIRE), Ice Punch (ICE), ThunderPunch (ELECTRIC), Vine Whip (GRASS), Bite (DARK), Razor Leaf (GRASS), Waterfall (WATER), Clamp (WATER), Crabhammer (WATER), Thief (DARK), Flame Wheel (FIRE), Faint Attack (DARK), Outrage (DRAGON), Spark (ELECTRIC), Sacred Fire (FIRE), Pursuit (DARK), Crunch (DARK), Beat Up (DARK), Knock Off (DARK), Dive (WATER), Blaze Kick (FIRE), Ice Ball (ICE), Needle Arm (GRASS), Bullet Seed (GRASS), Icicle Spear (ICE), Dragon Claw (DRAGON), Volt Tackle (ELECTRIC), Leaf Blade (GRASS). In addition, the following moves are physical despite having special attack types: Payback (DARK), Assurance (DARK), Fling (DARK), Punishment (DARK), Sucker Punch (DARK), Flare Blitz (FIRE), Night Slash (DARK), Aqua Tail (WATER), Seed Bomb (GRASS), Dragon Rush (DRAGON), Avalanche (ICE), Ice Shard (ICE), Thunder Fang (ELECTRIC), Ice Fang (ICE), Fire Fang (FIRE), Psycho Cut (PSYCHIC), Zen Headbutt (PSYCHIC), Power Whip (GRASS), Wood Hammer (GRASS), Aqua Jet (WATER)
New GitHub Repository
Posted: October 14, 2012 Filed under: Uncategorized Leave a comment »Today I’ve new set up a new account on GitHub, a site for programming projects. Currently I have a color picker online, which is now in use on my site. If you’re a programmer, take a look:
http://peteroupc.github.com/colorpicker
They commented, commented, and commented, according to YouTube
Posted: October 9, 2012 Filed under: Uncategorized Leave a comment »On my YouTube homepage today, in one of my subscriber’s videos, YouTube had this to say about it:
[username] uploaded, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented, commented and commented
That’s obviously too silly. It would have been better if the homepage just said:
[username] uploaded and commented many times
More on official terms
Posted: October 5, 2012 Filed under: Pokemon Leave a comment »Some terms used by Pokémon fans, and others are used by the official site and official guides in some cases.
- Legendary Pokémon: Generally refers to rare Pokémon that usually occur only once. Most of these appear at the end of the game’s Pokédex. In reality, there are two kinds of “Legendary Pokémon”, which are not officially distinguished by terminology:
- The first kind refers to Pokémon that come in pairs or trios: Articuno, Zapdos, and Moltres; Raikou, Entei, and Suicune; Latios and Latias; Regice, Registeel, and Regirock (and Regigigas); Azelf, Mesprit, and Uxie†; Cobalion, Terrakion, and Virizion‡; and Thundurus, Tornadus, and Landorus.
- The second kind refers to Pokémon that are usually banned in official tournaments. Most of these Pokémon are pictured on the box art for a Pokémon version: Mewtwo, Lugia, Ho-Oh, Kyogre, Groudon, Rayquaza, Dialga, Palkia, Giratina, Reshiram, Zekrom, Kyurem.
- Mythical Pokémon: Refers to Pokémon that are not available through normal gameplay, and then only for a limited time in special promotions. Like the second kind of Legendary Pokémon, these are usually banned in official tournaments. These are: Mew, Celebi, Jirachi, Deoxys, Phione, Manaphy, Darkrai, Shaymin, Arceus, Victini, Keldeo, Meloetta, Genesect.
- Signature move: A move known by (or associated with) only one Pokémon species. For example, Smeargle’s signature move is Sketch and Darkrai’s signature move is Dark Void.
- Starter Pokémon: This term, which is also used by many fans, refers to one of the Pokémon a player chooses from when a new game begins, such as Charmander, Bulbasaur, and Squirtle.
- Forme: This special word, which means an alternate form of some Pokémon species, is said only of some of those species, not all species with alternate forms: Deoxys, Shaymin, Giratina, Meloetta, Tornadus, Thundurus, and Landorus. For other species, I tend to use the word “alternate form” or simply “form”.
One of my recent goals is to defer to official terms like those above whenever possible. I will admit, though, that, for instance, the distinction between the two kinds of Legendary Pokémon is useful. In that case, recognizing that people may define the term “banned Pokémon” differently, I may use the term “Mythical and powerful Legendary Pokémon” to refer to Pokémon that are usually banned in official tournaments.
† For example, see p. 168 and 171 of Pokémon Diamond & Pokémon Pearl: The Official Pokémon Scenario Guide.
‡ For example, see p. 112 of Pokémon Black & Pokémon White Versions – The Official Unova Pokédex and Guide: Volume 2.
A user-friendly version of Antar’s stall factor article
Posted: October 3, 2012 Filed under: Uncategorized Leave a comment »The following is an edited version of Antar’s article on the “stall factor”, or a number that states a Pokémon team’s overall focus. It is posted here with Antar’s permission. The original article contains several terms that may be unfamiliar to some Pokémon fans, as I’ve written about before. For that reason, I’ve edited the article to a form accessible to ordinary Pokémon fans, and republished it here. I hope it uses only terminology found in the official games and guides.
Please note that I did not write the original article; please post your comments about its content to the original source, found at:
http://pokemetrics.wordpress.com/2012/08/16/measuring-stall-2/
Read the rest of this entry »