Re: korean character sets [message #182659] |
Sat, 24 August 2013 11:46 |
Cal Dershowitz
Messages: 36 Registered: February 2013
Karma:
|
Member |
|
|
On 08/22/2013 05:17 AM, Ben Bacarisse wrote:
> Cal Dershowitz <cal(at)example(dot)invalid> writes:
> <snip>
>> Then I fire up google translate, pasting the 3 paragraphs in, and
>> first lifting out the cyrillic characters that say the right thing and
>> stuff them in a file called russian1 . Then I take the phonetic
>> output that they give you now just because you asked and stuffed it in
>> a file called russian2.
>>
>> http://merrillpjensen.com/pages/obamazombies_3.php
>
> Why do you think this is a Perl question? It is more likely to be a PHP
> one, so a PHP group might be better.
[x-posted to c.l.php]
I find that many applications are mixtures. For example, I would not
use php to template a php page. The topic here is the perl templating
of php and is topical in both these groups.
>
> In case it helps you frame the question better when you do post in a
> suitable group, I offer a few observations:
>
> The server does not specify a character encoding when serving the
> page. Not fatal, but it sure helps to get that sorted out.
>
> Almost all the key data is missing. What actually is in "russian1"?
> When you post it (to the right group) a hex dump might be the best way
> to show the contents, but "cat -A" would also work.
>
> You don't show the PHP code, and I am not sure you show the template
> that the code is acting on. You did post a file that might have been
> the template but it did not look like one to me. It certainly contained
> no clues as to what processing happens to build the page.
>
> Please don't take this an invitation to discuss PHP, server
> configuration, or any other non-Perl topics here.
>
I've been posting improving perl for a long time here, and ask for the
benefit of the doubt. You wouldn't want me to have to call wade ward,
would you?
Anyways, the problem was that I was running utf-8 characters through
html entities, and if you want to see a bunch of upside-down question
marks, you can do that too.
Q1) If I'm typing on this keyboard and herd the corresponding utf-8
characters between paragraph tags, do I ever need to call HTML::Entities
to sort out what I did?
There's always a bit of html in any properly-phrased question along
these lines.
This counts as successful output, subject to comment:
http://merrillpjensen.com/pages/obamazombies_1.php
# captions
my $caption = <$CAPTIONS>;
# I think the next line is a mistake.
# $caption = encode_entities($caption);
printf $fh $template, "${word2}/" . $remote_file, $caption;
There remains a variety of smaller issues, like how to template a
reasonable button capability without wanting to get into forms, where
I'd be all ears.
This is what I've got so far:
http://merrillpjensen.com/pages/korean2_2.php
Make your own delicious american coffee.
--
Cal
|
|
|