A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Windows 10 » Windows 10 Help Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Append to UTF 16



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old July 10th 19, 07:10 AM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Append to UTF 16

Hi All,

Any of you guys know how to append to a UTF16 text file
from the command line?

echo abc SomeUTF16File.txt

All I get is goofy characters.

Many thanks,
-T
Ads
  #2  
Old July 10th 19, 09:01 AM posted to alt.comp.os.windows-10
Andy Burns[_6_]
external usenet poster
 
Posts: 1,318
Default Append to UTF 16

T wrote:

Any of you guys know how to append to a UTF16 text file
from the command line?

echo abc SomeUTF16File.txt

All I get is goofy characters.


Might not help, but does the file start with a BOM?

tried "chcp 1200" ?


  #3  
Old July 10th 19, 09:12 AM posted to alt.comp.os.windows-10
Ralph Fox
external usenet poster
 
Posts: 474
Default Append to UTF 16

On Tue, 9 Jul 2019 23:10:23 -0700, T wrote:

Hi All,

Any of you guys know how to append to a UTF16 text file
from the command line?

echo abc SomeUTF16File.txt

All I get is goofy characters.

Many thanks,
-T



CMD /U /C echo abc SomeUTF16File.txt


REFERENCE

Cmd | Microsoft Docs
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd

Parameters
...
/u Formats internal command output to a pipe or a file as Unicode.



--
Kind regards
Ralph
  #4  
Old July 10th 19, 06:10 PM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Append to UTF 16

On 7/10/19 1:12 AM, Ralph Fox wrote:
On Tue, 9 Jul 2019 23:10:23 -0700, T wrote:

Hi All,

Any of you guys know how to append to a UTF16 text file
from the command line?

echo abc SomeUTF16File.txt

All I get is goofy characters.

Many thanks,
-T



CMD /U /C echo abc SomeUTF16File.txt


REFERENCE

Cmd | Microsoft Docs
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd

Parameters
...
/u Formats internal command output to a pipe or a file as Unicode.




Thank you!
  #5  
Old July 10th 19, 06:11 PM posted to alt.comp.os.windows-10
T
external usenet poster
 
Posts: 4,600
Default Append to UTF 16

On 7/10/19 1:01 AM, Andy Burns wrote:
T wrote:

Any of you guys know how to append to a UTF16 text file
from the command line?

echo abc SomeUTF16File.txt

All I get is goofy characters.


Might not help, but does the file start with a BOM?

tried "chcp 1200" ?



I just got garble, which told me it was UTF 16 and I was
appending utf8u

  #6  
Old July 11th 19, 06:13 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
T
external usenet poster
 
Posts: 4,600
Default UTF-8/ASCII, not UTF-16, is the standard.

On 7/10/19 12:43 PM, "Jeff-Relf.Me@."@ wrote:
UTF-8/ASCII, not UTF-16, is the standard for:

-- FileNames ( all operating systems ).
-- CommandLine Utilities ( e.g. "YouTube-DL.EXE" ).
-- The Internet ( e.g. ".HTML" files ).

Hence ( http://Jeff-Relf.Me/Win10.REG.TXT ):

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"autorun"="C:\\__\\_Source\\Init-CMD.BAT"

"Init-CMD.BAT":

@chcp 65001
@prompt $P$_$g

Also, I wrote my own console ( http://Jeff-Relf.Me/X.HTM ).
Mostly it's used for my Visual C++ routines,
but it also runs "YouTube-DL.EXE" directly, without "CMD.EXE".

From "X.CPP" in "http://Jeff-Relf.Me/X.ZIP":

SECURITY_ATTRIBUTES Inherit = { sizeof( SECURITY_ATTRIBUTES ) };
Inherit.bInheritHandle = 1 ; static HANDLE r, w ;
CreatePipe( &r, &w, &Inherit, 0 );
SetHandleInformation( r, HANDLE_FLAG_INHERIT, 0 );

STARTUPINFO SU ={ sizeof( STARTUPINFO ) };
SU.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
SU.wShowWindow = SW_HIDE, SU.hStdOutput = SU.hStdError = w;
SU.hStdInput = GetStdHandle( STD_INPUT_HANDLE );


I wrote and maintain a program to check the Internet for new program
revisions of software I use at customer sites and download
any new revisions I found. Some of the the TRASH I have to
deal with on downloaded web pages is a thing to behold.

I gave up trying to get the UTF8 and UTF8U converters
to solve the issue. I eventually read one site as a binary
buffer of bytes, lopped off the high bit, and then converted
to a string. Problem solved.

Why the heck would you use the high bit on a ASCII web page,
but there is not explaining some of the things I found. I
find all kinds of weird characters at the end of lines too.
I have gotten really good at regex's and can lop that
trash off with alacrity.

One thing that always amuses me is folks that use 1000+
character long lines in their HTML code. Must be a total
nightmare to maintain. Regex to the rescue.



  #7  
Old July 11th 19, 06:19 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
nospam
external usenet poster
 
Posts: 4,718
Default UTF-8/ASCII, not UTF-16, is the standard.

In article , wrote:

Why the heck would you use the high bit on a ASCII web page,


because the desired characters aren't available otherwise.
  #8  
Old July 11th 19, 07:59 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
Siri Cruise
external usenet poster
 
Posts: 22
Default UTF-8/ASCII, not UTF-16, is the standard.

In article ,
nospam wrote:

In article , wrote:

Why the heck would you use the high bit on a ASCII web page,


because the desired characters aren't available otherwise.


The HTML source can and should be ASCII only. You can use entity references for
anything outside of ASCII. That lets the browser know what character is intended
and present it as the browser pleases rather than make the browser guess what
octets 80 to FF mean.

--
:- Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
The first law of discordiamism: The more energy This post / \
to make order is nore energy made into entropy. insults Islam. Mohammed
  #9  
Old July 11th 19, 08:28 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
T
external usenet poster
 
Posts: 4,600
Default UTF-8/ASCII, not UTF-16, is the standard.

On 7/11/19 11:59 AM, Siri Cruise wrote:
In article ,
nospam wrote:

In article , wrote:

Why the heck would you use the high bit on a ASCII web page,


because the desired characters aren't available otherwise.


The HTML source can and should be ASCII only. You can use entity references for
anything outside of ASCII. That lets the browser know what character is intended
and present it as the browser pleases rather than make the browser guess what
octets 80 to FF mean.


Ya, you think? "Suppose to" and "does" are two different things.
And good luck complaining to the web site about it.


I see a lot of
a href=/downloadsdownloads[trash][trash][trash]/a


But I have gotten pretty good and zapping the trash. Regex's
will drive you insane until your learn how to use them Then
they are kind of fun.

Now exactly what is s/\/\/\\/\/\\/\//g anyway?

:-)
  #10  
Old July 11th 19, 08:54 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
T
external usenet poster
 
Posts: 4,600
Default UTF-8/ASCII, not UTF-16, is the standard.

On 7/11/19 12:41 PM, "Jeff-Relf.Me@."@ wrote:
Siri_Cruise:
The HTML source can and should be ASCII only.


Yes, and all puppies should go to heaven.


Chuckle.

  #11  
Old July 11th 19, 09:42 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
nospam
external usenet poster
 
Posts: 4,718
Default UTF-8/ASCII, not UTF-16, is the standard.

In article
, Siri
Cruise wrote:

Why the heck would you use the high bit on a ASCII web page,


because the desired characters aren't available otherwise.


The HTML source can and should be ASCII only.
You can use entity references
for
anything outside of ASCII. That lets the browser know what character is
intended
and present it as the browser pleases rather than make the browser guess what
octets 80 to FF mean.


no need to guess when done correctly.
  #12  
Old July 11th 19, 10:19 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
Siri Cruise
external usenet poster
 
Posts: 22
Default UTF-8/ASCII, not UTF-16, is the standard.

In article ,
nospam wrote:

In article
, Siri
Cruise wrote:

Why the heck would you use the high bit on a ASCII web page,

because the desired characters aren't available otherwise.


The HTML source can and should be ASCII only.
You can use entity references
for
anything outside of ASCII. That lets the browser know what character is
intended
and present it as the browser pleases rather than make the browser guess
what
octets 80 to FF mean.


no need to guess when done correctly.


Just ASCII with entity references in ASCII is always correct. And it's easy to
do.

--
:- Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
The first law of discordiamism: The more energy This post / \
to make order is nore energy made into entropy. insults Islam. Mohammed
  #13  
Old July 11th 19, 10:19 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
Siri Cruise
external usenet poster
 
Posts: 22
Default UTF-8/ASCII, not UTF-16, is the standard.

In article , Jeff-Relf.Me @.@ wrote:

Siri_Cruise:
The HTML source can and should be ASCII only.


Yes, and all puppies should go to heaven.


They do.

--
:- Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
The first law of discordiamism: The more energy This post / \
to make order is nore energy made into entropy. insults Islam. Mohammed
  #14  
Old July 11th 19, 10:21 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
T
external usenet poster
 
Posts: 4,600
Default UTF-8/ASCII, not UTF-16, is the standard.

On 7/11/19 2:19 PM, Siri Cruise wrote:
In article , Jeff-Relf.Me @.@ wrote:

Siri_Cruise:
The HTML source can and should be ASCII only.


Yes, and all puppies should go to heaven.


They do.


How about old dogs?
  #15  
Old July 11th 19, 10:21 PM posted to alt.comp.os.windows-10,comp.os.linux.advocacy
Siri Cruise
external usenet poster
 
Posts: 22
Default UTF-8/ASCII, not UTF-16, is the standard.

In article , T wrote:

On 7/11/19 11:59 AM, Siri Cruise wrote:
In article ,
nospam wrote:

In article , wrote:

Why the heck would you use the high bit on a ASCII web page,

because the desired characters aren't available otherwise.


The HTML source can and should be ASCII only. You can use entity references
for
anything outside of ASCII. That lets the browser know what character is
intended
and present it as the browser pleases rather than make the browser guess
what
octets 80 to FF mean.


Ya, you think? "Suppose to" and "does" are two different things.
And good luck complaining to the web site about it.


I see a lot of
a href=/downloadsdownloads[trash][trash][trash]/a


On any sites not using microsoft?

--
:- Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
The first law of discordiamism: The more energy This post / \
to make order is nore energy made into entropy. insults Islam. Mohammed
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 08:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.