Tuesday, August 31, 2010

FPDF °C become °C

Keyword
FPDF °C become °C
FPDF °C problem
FPDF symbol problem
FPDF degree celsius temperature problem

I having a bug when I create a file from FPDF the character when wrong.
The wrong is the symbol where °C become °C

I try to change the FPDF font into UTF-8 by embedding UTF-8 font into it but still problem (my database and html page display the °C correctly)

after several experimenting cause googling is failed (4 hours of stress)
the reaseon is because of my page encoding. FPDF write into the paper using 'ISO-8859-1' encoding.
Thus UTF-8 is °C and when it write it become ISO-8859-1 which is °C

So long for the chatting lets cut to the point

use utf8_decode("°C") will solve your problem. It will convert UTF-8 to ISO-8859-1

HOpe this help cause 'quick googling' disappoint me

Just for my own reference to converting string

Javascript change dropdown or select option value which is index

I google for "javascript change select value" and turn out not really help full
The keyword for select is more like dropdown
while the value is index
So it must be "javascriptchange dropdown index"

The purpsoe of this post is a javascript is to change the selection inside the dropdown into something you want.



Just like the dropdown above. The default value is seet to the first option which is "Hello"
When I click a certain script with value "World", the script will change the dropdown into to "World". This is what I want. Below is the code


function changeDropDown( dropdownidname, dropdownvalue)
{
var testingga = window.opener.document.EditView.elements[dropdownidname];
//In most case it will be document.getElementById(dropdownidname); I think

for (var i=0; i < testingga.length; i++)
{
if (testingga[i].value == dropdownvalue)
{
testingga[i].selected = true;
}
}
}

Tuesday, August 10, 2010

Web Graph

I surfing the net and come across with this http://www.rgraph.net
It provide you with a graph creation for website development. Pretty nice compared with JPGraph
Its a free for non business (only 1 time payment for business)