1776
Post New Requests Here / Re: REQ: Convert/Export Certain Browser's "Groups" as Chrome Bookmarks
« Last post by 4wd on July 01, 2015, 08:16 PM »(^ ^!) I think with about a hundred lines flashing past in the span of a few seconds for all the cgps I had to convert, I would need to have super humanly fast reading speed, rather than slower, to catch that 1 line at the beginning.-Cocoa (July 01, 2015, 02:39 PM)
DOH! Sorry, forgot I was dealing with a serial bookmarker

UPDATED: I've moved it to the bottom.
In case you or anyone else feels like adding additional features in the future, such as reverse converting back from html to cgp, I'll still more than welcome them.
Should be easy enough to go the other way since the .cgp format is even simpler.
BTW, I'm curious about the workings of the program you found that could perform encoding conversions. Could you provide a link to the original?
I didn't need it, Powershell does the necessary conversion - all you need to do is tell it what the input character encoding is (in this case gb2312 - here's a list) and what output encoding you want (UTF-8).
I was going to use the other program if I continued on with using a normal command file. I've since deleted it but here's a simple Powershell script that does the same thing - paste below into a file called X2UTF8.ps1
There's no error checking, so you need to get encoding and file paths correct.
Code: PowerShell [Select]
- <#
- .SYNOPSIS
- Converts text files to UTF-8
- .DESCRIPTION
- Reads text file according to encoding specified, saves to UTF-8 file.
- .PARAMETER
- <input encoding> - encoding of original file.
- <infile> - file to convert.
- <outfile> - output file.
- .EXAMPLE
- PS> X2UTF8.ps1 gb2312 input.txt output.txt
- #>
- Param(
- [String]$Encoded,
- [String]$SourceFile,
- [String]$Destfile
- )
- $Buffer = Get-Content $SourceFile -Encoding byte
- $Encoding = [System.Text.Encoding]::GetEncoding($Encoded)
- $String = $Encoding.GetString($Buffer)
- Out-File -FilePath $Destfile -Encoding utf8 -InputObject $String
Open a Powershell console and call as: .\x2utf8.ps1 <encoding> <input file> <output file>
eg. .\X2UTF8.ps1 gb2312 D:\test\12_31-03.47.29.cgp K:\test.txt

Recent Posts

)