Wrong character count

Wrong character count

3
NewbieNewbie
3

    Dec 21, 2005#1

    Hi there!

    I'm actually using UE for translation script (ie. it's some code & tags + some text to translate). Translating from English to French, I have to follow a character limitation (French usually longer than English). When selecting some text, I go in "Search/Word count" and it gives me something that is not correct.
    Example: if I select the text "western section", UE tells me it's 5 characters without spaces and 8 with spaces... Counting manually, it's actually 15 characters.

    I'm a complete newbie at this, but maybe someone can tell me if there's a way to get a correct character count for a text selection (macro + hot key).

    Would a javascript like this be working somehow?

    Thanks a bunch!

    206
    MasterMaster
    206

      Dec 21, 2005#2

      I assigned a key combination to the SearchWordCount command, using the UE Key Mapping Configuration. When I select "western section" and execute the keystroke, the dialog reports 15 characters selected (with spaces).


      I'm using 11.20a.
      Software For Metalworking
      http://closetolerancesoftware.com

      6,686585
      Grand MasterGrand Master
      6,686585

        Dec 21, 2005#3

        5 and 8 characters, I can't see that. But it's easier not to use Word Count feature here. After selection look at the status bar at bottom of the UltraEdit window. You will see at right edge Bytes Sel: 15.

        Don't forget, that a tab character is counted as 1 but depending to your tab settings displayed with i.e. 8 spaces. And line break characters CR+LF are also counted, if you select it.
        Best regards from an UC/UE/UES for Windows user from Austria

        3
        NewbieNewbie
        3

          Dec 21, 2005#4

          mrainey56 wrote:I assigned a key combination to the SearchWordCount command, using the UE Key Mapping Configuration. When I select "western section" and execute the keystroke, the dialog reports 15 characters selected (with spaces).

          I'm using 11.20a.
          Strangely enough, the SearchWordCount command still gives me 5 without spaces and 8 with spaces... I'm clueless.
          Mofi wrote:5 and 8 characters, I can't see that. But it's easier not to use Word Count feature here. After selection look at the status bar at bottom of the UltraEdit window. You will see at right edge Bytes Sel: 15.
          Silly me, didn't notice that. Strange again though, it gives me "30" and (after a few other attempts) basically always gives me the double of the real character count... Better than nothing.

          As for the version it's my old 10.10...

          Thanks anyway for the pieces of answer!

          6,686585
          Grand MasterGrand Master
          6,686585

            Dec 22, 2005#5

            Now I know what's going on. You are editing a file in Unicode, where every character is a 2 byte character. "western section" for example is stored in Unicode as
            77 00 65 00 73 00 74 00 65 00 72 00 6E 00 20 00 73 00 65 00 63 00 74 00 69 00 6F 00 6E 00

            Look again at the status bar, where the file format is shown. I guess, you will see U-DOS. You can convert the Unicode file to ASCII to get correct results. But don't forget to convert it back to Unicode before last save. And read about BOM (byte order marker) in help of UltraEdit or forum. Check if your file has already one or not, because the BOM is lost at conversion to ASCII and have to recreate it according to what is was before conversion when converting the file back to Unicode. Toggle to hex view and look at the first 2 bytes of the file. A little endian Unicode file for example has FF FE as BOM, if a BOM exists.

            But you are right with the word count. The total values are correct, but the selected values are calculated wrong by UltraEdit v11.20a by a factor of 2 if the file is a Unicode file. I will report this to IDM.
            Best regards from an UC/UE/UES for Windows user from Austria

            3
            NewbieNewbie
            3

              Dec 22, 2005#6

              Indeed, the file is in UTF8 (it has Japanese characters in it).
              I think I will just stick to dividing the number shown at the bottom right by 2.
              Fair enough :-)

              Thanks a lot!

              6,686585
              Grand MasterGrand Master
              6,686585

                Jan 30, 2006#7

                The problem with the wrong word and character count for a selection in an Unicode file is fixed with v11.20b of UltraEdit.
                Best regards from an UC/UE/UES for Windows user from Austria