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. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
|
|