Connecting Tech Pros Worldwide Forums | Help | Site Map

Help: Need function to translate windows-874 to UTF-8

GreyWyvern
Guest
 
Posts: n/a
#1: Jul 17 '05
Hello all!

I'm in need of an algorithm to change windows-874 (Thai) encoding to
UTF-8, without using PHPs iconv or similar functions. I've done the
requisite googling and searching through the notes on php.net but nothing
(that I could see) has turned up.

Right now I'll be looking for pages explaining the inner workings of
windows-874 in the hopes that I might be able to code the algorithm
myself, but I thought I'd ask here as a last desperate hope :)

Any programming language is fine. I'll just translate it to PHP.

Yours in hope,
Grey

[x-posted to comp.lang.php 'cause I hear you guys are great, even though I
don't subscribe :) Please reply in a.w.w, thanks.]

Daniel Tryba
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


GreyWyvern <SP_bhuisman@greywyvern.com_am> wrote:[color=blue]
> I'm in need of an algorithm to change windows-874 (Thai) encoding to
> UTF-8, without using PHPs iconv or similar functions.[/color]

Sounds silly... Why not use these excellent tools in PHP.

[thais -> utf8][color=blue]
> Any programming language is fine. I'll just translate it to PHP.[/color]

Take a look at the iconv source, it's open and it's free. If it supports
your source encoding, an alogorithm (or more likely a table) can be
gotten there.

--

Daniel Tryba

GreyWyvern
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


On Tue, 27 Apr 2004 13:14:02 +0000 (UTC), Daniel Tryba
<news_alt.www.webmaster@canopus.nl> wrote:
[color=blue]
> GreyWyvern <SP_bhuisman@greywyvern.com_am> wrote:[color=green]
>> I'm in need of an algorithm to change windows-874 (Thai) encoding to
>> UTF-8, without using PHPs iconv or similar functions.[/color]
>
> Sounds silly... Why not use these excellent tools in PHP.
>
> [thais -> utf8][color=green]
>> Any programming language is fine. I'll just translate it to PHP.[/color]
>
> Take a look at the iconv source, it's open and it's free. If it supports
> your source encoding, an alogorithm (or more likely a table) can be
> gotten there.[/color]

I would if I could, and I've actually asked my host to install these
libraries. But for the sake of backward compatibility, and since iconv is
a relatively new PHP function in the scheme of things, and since I need
this algorithm for a script which will be distributed to multiple servers
with varying versions of PHP, I need a catch all translation which will
work always. Or at least back until 4.0.x

Thanks for you response, tho.

Grey
Daniel Tryba
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


GreyWyvern <SP_bhuisman@greywyvern.com_am> wrote:[color=blue][color=green]
>> [thais -> utf8][color=darkred]
>>> Any programming language is fine. I'll just translate it to PHP.[/color]
>>
>> Take a look at the iconv source, it's open and it's free. If it supports
>> your source encoding, an alogorithm (or more likely a table) can be
>> gotten there.[/color]
>
> I would if I could, and I've actually asked my host to install these
> libraries. But for the sake of backward compatibility, and since iconv is
> a relatively new PHP function in the scheme of things, and since I need
> this algorithm for a script which will be distributed to multiple servers
> with varying versions of PHP, I need a catch all translation which will
> work always. Or at least back until 4.0.x[/color]

So what is keeping you from looking at the iconv source? You don't need
any php support for that :)

--

Daniel Tryba

Justin Koivisto
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


GreyWyvern wrote:[color=blue]
> Hello all![/color]

hello again.
[color=blue]
> I'm in need of an algorithm to change windows-874 (Thai) encoding to
> UTF-8, without using PHPs iconv or similar functions. I've done the
> requisite googling and searching through the notes on php.net but
> nothing (that I could see) has turned up.
>
> Right now I'll be looking for pages explaining the inner workings of
> windows-874 in the hopes that I might be able to code the algorithm
> myself, but I thought I'd ask here as a last desperate hope :)
>
> Any programming language is fine. I'll just translate it to PHP.[/color]

OK, if you aren't going to hit the PHP iconv C source to find it, how
about some Perl?

http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8

....of particular interest to you:
"windows874 convert from windows-874 to UTF-8"
"illegal_windows874 remove characters illegal for windows-874"

Probably not exactly what you are looking for, but you may be able to
find what you need in here....

You can view the source directly here:
http://search.cpan.org/src/ELIZABETH...Trieve/UTF8.pm

HTH - and yes, c.l.php is great! :P

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/
GreyWyvern
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


On Tue, 27 Apr 2004 13:34:25 +0000 (UTC), Daniel Tryba
<news_alt.www.webmaster@canopus.nl> wrote:
[color=blue]
> So what is keeping you from looking at the iconv source? You don't need
> any php support for that :)[/color]

I am, actually. But searching through 15MB of code to find out how the
functions I need work together takes time ;)

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system
GreyWyvern
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


On Tue, 27 Apr 2004 13:50:38 GMT, Justin Koivisto <spam@koivi.com> wrote:
[color=blue]
> OK, if you aren't going to hit the PHP iconv C source to find it, how
> about some Perl?
>
> http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8
>
> ...of particular interest to you:
> "windows874 convert from windows-874 to UTF-8"
> "illegal_windows874 remove characters illegal for windows-874"[/color]

Awesome! Exactly what I needed! It's now translated to PHP and working
perfectly!

Thanks muchly muchly, man :D I owe you a beer.

Grey
Justin Koivisto
Guest
 
Posts: n/a
#8: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


GreyWyvern wrote:[color=blue]
> On Tue, 27 Apr 2004 13:50:38 GMT, Justin Koivisto <spam@koivi.com> wrote:
>[color=green]
>> OK, if you aren't going to hit the PHP iconv C source to find it, how
>> about some Perl?
>>
>> http://search.cpan.org/~elizabeth/Ne...NVERT_TO_UTF-8
>>
>>
>> ...of particular interest to you:
>> "windows874 convert from windows-874 to UTF-8"
>> "illegal_windows874 remove characters illegal for windows-874"[/color]
>
>
> Awesome! Exactly what I needed! It's now translated to PHP and
> working perfectly!
>
> Thanks muchly muchly, man :D I owe you a beer.[/color]

No problem, but I believe that this would make 2 beers now. ;)

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
GreyWyvern
Guest
 
Posts: n/a
#9: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <spam@koivi.com> wrote:
[color=blue][color=green]
>> Thanks muchly muchly, man :D I owe you a beer.[/color]
>
> No problem, but I believe that this would make 2 beers now. ;)[/color]

Really? What was the first one for? No matter, this one was worth at
least two anyway ;P

Grey
Justin Koivisto
Guest
 
Posts: n/a
#10: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


GreyWyvern wrote:
[color=blue]
> On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <spam@koivi.com> wrote:
>[color=green][color=darkred]
>>> Thanks muchly muchly, man :D I owe you a beer.[/color]
>>
>>
>> No problem, but I believe that this would make 2 beers now. ;)[/color]
>
>
> Really? What was the first one for? No matter, this one was worth at
> least two anyway ;P[/color]

PNG-24 transparencies... ;)

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
GreyWyvern
Guest
 
Posts: n/a
#11: Jul 17 '05

re: Help: Need function to translate windows-874 to UTF-8


On Tue, 27 Apr 2004 20:46:18 GMT, Justin Koivisto <spam@koivi.com> wrote:
[color=blue]
> GreyWyvern wrote:
>[color=green]
>> On Tue, 27 Apr 2004 18:17:57 GMT, Justin Koivisto <spam@koivi.com>
>> wrote:
>>[color=darkred]
>>>> Thanks muchly muchly, man :D I owe you a beer.
>>>
>>>
>>> No problem, but I believe that this would make 2 beers now. ;)[/color]
>> Really? What was the first one for? No matter, this one was worth
>> at least two anyway ;P[/color]
>
> PNG-24 transparencies... ;)[/color]

Gah! 'tis true! Make it an even three then :)

Grey
Closed Thread