--- a/rfpdf/lib/fpdf/korean.rb 2011-01-25 17:50:48.000000000 -0500 +++ b/rfpdf/lib/fpdf/korean.rb 2011-03-23 17:48:59.000000000 -0400 @@ -101,7 +101,7 @@ while(iwmax) #Automatic line break if(sep==-1 or i==j) @@ -188,7 +184,7 @@ Cell(w,h,s[j,i-j],b,2,align,fill) else Cell(w,h,s[j,sep-j],b,2,align,fill) - i=(s[sep]==' ') ? sep+1 : sep + i=(s[sep].chr==' ') ? sep+1 : sep end sep=-1 j=i @@ -202,7 +198,7 @@ end end #Last chunk - if(border and not border.index('B').nil?) + if(border and not border.to_s.index('B').nil?) b+='B' end Cell(w,h,s[j,i-j],b,2,align,fill) @@ -234,7 +230,7 @@ c=s[i] #Check if ASCII or MB ascii=(c<128) - if(c=="\n") + if(c.chr=="\n") #Explicit line break Cell(w,h,s[j,i-j],0,2,'',0,link) i+=1 @@ -249,10 +245,10 @@ nl+=1 next end - if(!ascii or c==' ') + if(!ascii or c.chr==' ') sep=i end - l+=ascii ? cw[c.chr] : 1000 + l+=(ascii ? cw[c.chr] : 1000) || 0 if(l>wmax) #Automatic line break if(sep==-1 or i==j) @@ -272,7 +268,7 @@ Cell(w,h,s[j,i-j],0,2,'',0,link) else Cell(w,h,s[j,sep-j],0,2,'',0,link) - i=(s[sep]==' ') ? sep+1 : sep + i=(s[sep].chr==' ') ? sep+1 : sep end sep=-1 j=i