Luca Accomazzi | 2 Apr 09:52 2007
Picon

Unicode woes

I am having troubles using BBEdit together with MySQL and I was  
hoping the communal mind of the list might help me. I have a MySQL  
database containing the localization of the strings for my webapp.  
The database is Unicode:
CREATE DATABASE `sarat` /*!40100 DEFAULT CHARACTER SET utf8 */;
The table is Unicode:
CREATE TABLE `unilocal` (
   `stringa` text character set utf8
[...etcetera...]
My Terminal is set to Unicode. If, for example, I "SELECT stringa  
FROM unilocal", for a Russian text, I do see the correct Cyrillic  
text in my Terminal window. So far, so good.

Now, if I SELECT the same string INTO OUTFILE 'whatever.txt' and I  
open whatever.txt, then I see garbled text. At the bottom, I see that  
BBEdit correctly opened the file as unicode utf-8 no bom. And I'm  
stumped.

What I'm really trying to do is importing some new translations into  
the database. Again, in BBEdit I see garbage. If I try to go ahead  
and import blindly, I get MOSTLY garbage (lowercase Cyrillic letters  
seem OK, uppercase and punctuation is garbled).

Banging my head into the wall repeatedly doesn't seem to help, too.  
Oh: latest BBEdit and MySQL 5.0.24a-standard, just in case this makes  
any difference.

L.A.

--

-- 
(Continue reading)

Jan Pieter Kunst | 2 Apr 10:26 2007
Picon

Re: Unicode woes

2007/4/2, Luca Accomazzi <luca <at> accomazzi.it>:
> I am having troubles using BBEdit together with MySQL and I was
> hoping the communal mind of the list might help me. I have a MySQL
> database containing the localization of the strings for my webapp.
> The database is Unicode:
> CREATE DATABASE `sarat` /*!40100 DEFAULT CHARACTER SET utf8 */;
> The table is Unicode:
> CREATE TABLE `unilocal` (
>    `stringa` text character set utf8
> [...etcetera...]
> My Terminal is set to Unicode. If, for example, I "SELECT stringa
> FROM unilocal", for a Russian text, I do see the correct Cyrillic
> text in my Terminal window. So far, so good.
>
> Now, if I SELECT the same string INTO OUTFILE 'whatever.txt' and I
> open whatever.txt, then I see garbled text. At the bottom, I see that
> BBEdit correctly opened the file as unicode utf-8 no bom. And I'm
> stumped.
>
> What I'm really trying to do is importing some new translations into
> the database. Again, in BBEdit I see garbage. If I try to go ahead
> and import blindly, I get MOSTLY garbage (lowercase Cyrillic letters
> seem OK, uppercase and punctuation is garbled).
>
> Banging my head into the wall repeatedly doesn't seem to help, too.
> Oh: latest BBEdit and MySQL 5.0.24a-standard, just in case this makes
> any difference.
>
> L.A.

(Continue reading)

Luca Accomazzi | 2 Apr 11:13 2007
Picon

Re: Unicode woes

JPK wrote:
> I think this is a MySQL issue, having to do with the character set of
> the result.
I also suspect MySQL of evilness.
> Try the following: before you do the 'SELECT INTO OUTFILE'
> thing, execute the following query:
>
> SET NAMES utf8;
That's great! Now I also get garbage in the Terminal window. The text  
file is still corrupted. 8-7

Still, it's a hint.
L.A.

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

Jan Pieter Kunst | 2 Apr 13:27 2007
Picon

Re: Unicode woes

2007/4/2, Luca Accomazzi <luca <at> accomazzi.it>:
> JPK wrote:
> > I think this is a MySQL issue, having to do with the character set of
> > the result.
> I also suspect MySQL of evilness.
> > Try the following: before you do the 'SELECT INTO OUTFILE'
> > thing, execute the following query:
> >
> > SET NAMES utf8;
> That's great! Now I also get garbage in the Terminal window. The text
> file is still corrupted. 8-7
>
> Still, it's a hint.
> L.A.

This is getting off-topic, but....

To make sure that mysql knows that you want to use utf-8, try calling
it like so from the CLI:

$ mysql --default_character_set=utf8

and make sure that the Terminal is talking utf-8 (Window Settings -> Display)

JP

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
(Continue reading)

Google Kreme | 2 Apr 20:46 2007
Picon

Changing line endings on a bunch of files

I currently have 34 html files open in a single window and I want to  
change ALL of them to Unix style line endings. Currently, a couple  
are Unix, some are Mac, and a couple are PC.

Anyway to do it that doesn't involved selecting the menu/popup 32 times?

-- 
There is something to be said for grace and respect but humour always  
helps - Toby Morris

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

Rich Siegel | 2 Apr 20:56 2007

Re: Changing line endings on a bunch of files

On 4/2/07 at 12:46 PM, gkreme <at> gmail.com (Google Kreme) wrote:

> I currently have 34 html files open in a single window and I want to
> change ALL of them to Unix style line endings. Currently, a couple are
> Unix, some are Mac, and a couple are PC.
> 
> Anyway to do it that doesn't involved selecting the menu/popup 32
> times?

How about a Text Factory with a "Change Line Endings" command?

R.
-- 
Rich Siegel                                 Bare Bones Software, Inc.
<siegel <at> barebones.com>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

Bryan R Harris | 2 Apr 21:24 2007

Re: Changing line endings on a bunch of files


>> I currently have 34 html files open in a single window and I want to
>> change ALL of them to Unix style line endings. Currently, a couple are
>> Unix, some are Mac, and a couple are PC.
>> 
>> Anyway to do it that doesn't involved selecting the menu/popup 32
>> times?
> 
> How about a Text Factory with a "Change Line Endings" command?

... or Linebreak:

http://mac.softpedia.com/get/Utilities/LineBreak.shtml

- B

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

Google Kreme | 2 Apr 22:23 2007
Picon

Re: Changing line endings on a bunch of files


On 2-Apr-2007, at 12:56, Rich Siegel wrote:

> On 4/2/07 at 12:46 PM, gkreme <at> gmail.com (Google Kreme) wrote:
>
>> I currently have 34 html files open in a single window and I want to
>> change ALL of them to Unix style line endings. Currently, a couple  
>> are
>> Unix, some are Mac, and a couple are PC.
>>
>> Anyway to do it that doesn't involved selecting the menu/popup 32
>> times?
>
> How about a Text Factory with a "Change Line Endings" command?

OK, I went ahead and tried that.  Setup a text factory with change  
line endings to unix, set it to "All open files" and told it to save  
files if there were changes, no confirmation.

Ran the text factory and all the files still show Mac line endings.

I put a screenshot of the text factory (I was down to 27 files at  
this point, all Mac (CR) EOL) up at:

<http://www.kreme.com/textfact.png>

--

-- 
Hey, baby, I've got just the cure for that penis envy back at my  
apartment...

(Continue reading)

Johan Solve | 3 Apr 00:10 2007
Picon

Re: Changing line endings on a bunch of files

At 14.23 -0600 2007-04-02, Google Kreme wrote:
>Ran the text factory and all the files still show Mac line endings.

I did the same, and the "Change Line Endings" action seems to have no effect for me either. Bug?
BB 8.6.1.
"Change Text Encoding" works fine though.
-- 
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:joh-n <at> montania.se
 (spam-safe email address, replace '-' with 'a')

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

Doug McNutt | 3 Apr 00:34 2007

Re: Changing line endings on a bunch of files

At 00:10 +0200 4/3/07, Johan Solve wrote:
>At 14.23 -0600 2007-04-02, Google Kreme wrote:
>>Ran the text factory and all the files still show Mac line endings.
>
>I did the same, and the "Change Line Endings" action seems to have no effect for me either. Bug?
>BB 8.6.1.

<ftp://ftp.macnauchtan.com/Software/LineEnds/FixEndsFolder.sit>  53 kB

is a set of drag and drop AppleScripts that I wrote. The idea is that you can drag a file onto the folder
containing the application and convert files in situ to DOS, Mac, or Unix line ends.  It is really for
working with one file at a time but the underlying operation is with a simple UNIX tool that is called from
AppleScript but it could easily be called from a shell script or a BBEdit worksheet.

The source code - in C - is in the download which also has a binary that can be executed as a tool. You give it a
file name and a one character switch. A "for each" loop on all files in a directory should be trivial in a
shell of your choice.

-- 

--> From the U S of A, the only socialist country that refuses to admit it. <--

--

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <support <at> barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <bbedit-talk-off <at> barebones.com>

(Continue reading)


Gmane