File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import * as path from "path";
33import { Uri } from "vscode" ;
44import { exists , mkdir , writeFile } from "./fs" ;
55import * as crypto from "crypto" ;
6+ import { iconv } from "./vscodeModules" ;
7+ import { configuration } from "./helpers/configuration" ;
68
79export const tempdir = path . join ( os . tmpdir ( ) , "vscode-svn" ) ;
810
@@ -19,12 +21,18 @@ export async function createTempSvnRevisionFile(
1921 const hash = crypto . createHash ( "md5" ) ;
2022 const data = hash . update ( svnUri . path ) ;
2123 const filePathHash = data . digest ( "hex" ) ;
24+ const encoding = configuration . get < string > ( "default.encoding" ) ;
2225
2326 if ( ! ( await exists ( path . join ( tempdir , filePathHash ) ) ) ) {
2427 await mkdir ( path . join ( tempdir , filePathHash ) ) ;
2528 }
2629
2730 const fpath = path . join ( tempdir , filePathHash , fname ) ;
28- await writeFile ( fpath , payload ) ;
31+ if ( encoding ) {
32+ const encodedPayload = iconv . encode ( payload , encoding ) ;
33+ await writeFile ( fpath , encodedPayload ) ;
34+ } else {
35+ await writeFile ( fpath , payload ) ;
36+ }
2937 return Uri . file ( fpath ) ;
3038}
You can’t perform that action at this time.
0 commit comments