utf8 support

View: New views
4 Messages — Rating Filter:   Alert me  

utf8 support

by Alvaro-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I am new user of tedia2sql, because I am spanish speaking have some
problems with inserts created by tedia2sql because don't have utf8
encode support, so I did a patch in perl code.

I don't know anything about perl, but I tryed and it works!

I explain it:

first you have tell perl about encode type to open and save files and
use of encode/decode functions:

use open IO  => ':utf8';
use Encode

I think that value (utf8) must be passed trough command line,
also there is a way to use 'locale' instead of 'utf8'

then when teadia2sql do:
print $iout &createInsertStatements ($compName, $compText);

you have to do

print $iout &createInsertStatements ($compName, decode('utf8,'$compText));

again it must be a value passed by command-line

Well I say again I don't know perl so checkit out please, if you like me
submit
a patch with command-line support and well code please tell me how I
submit that.

Greate work! very useful to me!
thanks

Alvaro


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: utf8 support

by Mike Ginou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alvaro,

Some preliminary investigation of utf8 support was made some time ago.
At the time it was concluded that simply adding

use open ':locale';

was sufficient to fix encoding mishaps (provided your locale is set
properly in your environment).

I have attached a very small patch that makes that fix, can you test it out?



Alvaro wrote:

> Hi,
> I am new user of tedia2sql, because I am spanish speaking have some
> problems with inserts created by tedia2sql because don't have utf8
> encode support, so I did a patch in perl code.
>
> I don't know anything about perl, but I tryed and it works!
>
> I explain it:
>
> first you have tell perl about encode type to open and save files and
> use of encode/decode functions:
>
> use open IO  => ':utf8';
> use Encode
>
> I think that value (utf8) must be passed trough command line,
> also there is a way to use 'locale' instead of 'utf8'
>
> then when teadia2sql do:
> print $iout &createInsertStatements ($compName, $compText);
>
> you have to do
>
> print $iout &createInsertStatements ($compName, decode('utf8,'$compText));
>
> again it must be a value passed by command-line
>
> Well I say again I don't know perl so checkit out please, if you like me
> submit
> a patch with command-line support and well code please tell me how I
> submit that.
>
> Greate work! very useful to me!
> thanks
>
> Alvaro
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

Index: tedia2sql
===================================================================
RCS file: /cvs/tedia2sql/tedia2sql,v
retrieving revision 1.68
diff -u -r1.68 tedia2sql
--- tedia2sql 19 Dec 2004 03:44:42 -0000 1.68
+++ tedia2sql 24 Apr 2007 13:52:28 -0000
@@ -52,6 +52,8 @@
 #  actual license is at http://www.gnu.org/licenses/gpl.txt as well.
 # ------------------------ LICENSE SUMMARY ------------------------------------
 
+use open ':locale';
+
 sub parseRCFile($);
 sub checkExtraClauseUsage();
 sub checkMacroUsage();


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

Parent Message unknown Re: utf8 support

by Mike Ginou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Today working on some files I see these aren't saved at utf8 and ask why?
> looking in my system I see utf8 don't was my default locale!
> when upgrade debian, the locale utf8 dissapear like default,
> so now revert the code of tedia2sql I haved to change and work perfectly!


So to be clear the standard debian standard version of tedia2sql works fine?

-Mike

PS - I'm glad it

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: utf8 support

by Alvaro-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mike Ginou escribió:

>> Today working on some files I see these aren't saved at utf8 and ask why?
>> looking in my system I see utf8 don't was my default locale!
>> when upgrade debian, the locale utf8 dissapear like default,
>> so now revert the code of tedia2sql I haved to change and work perfectly!
>>    
>
>
> So to be clear the standard debian standard version of tedia2sql works fine?
>
> -Mike
>
> PS - I'm glad it
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>
>  
work very pretty fine!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price