mac下eclipse不支持中文路径

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lislislislislis/article/details/88812258

1.打开eclipse安装目录,显示eclipse.app包内容

2.修改Contents/info.plist 文件,增加内容:

LSEnvironment

 <dict>  

     <key>JAVA_TOOL_OPTIONS</key>  

     <string>-Dfile.encoding=UTF-8</string>  

     <key>LANG</key>  

     <string>zh_CN.UTF-8</string>  

 </dict>

    //此处是默认文件的开始,加上面一段xml即可。

CFBundleExecutable

eclipse

3.修改Contents/MacOS/eclipse.ini文件

在末尾加上 -Dfile.encoding=UTF-8

重启eclipse即可(此处作者已经ok,没有执行第4步)。

4.如果没有生效执行/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/eclipse.app

展开阅读全文

搜索不支持中文路径

09-08

在搜索路径包含有中文字符时,就没办法搜索文件,就是说不支持中文路径,搞不明白为什么会这样,请大家指点一下,怎么解决?rnrnrnPublic Function FindDirs(curpath$)rn Dim dirs%, dirbuf$(), I%rn UseFileSpec% = Truern ' This loop finds *every* subdir and file in the current dirrn hItem& = FindFirstFile(curpath$ & vbAllFiles, WFD)rn If hItem& <> INVALID_HANDLE_VALUE Thenrn Dorn 'DoEventsrn If (WFD.dwFileAttributes And vbDirectory) Thenrn If Asc(WFD.cFileName) <> vbKeyDot Thenrn TotalDirs% = TotalDirs% + 1rn If (dirs% Mod 10) = 0 Thenrn ReDim Preserve dirbuf$(dirs% + 10)rn End Ifrn dirs% = dirs% + 1rn dirbuf$(dirs%) = left$(WFD.cFileName, InStr(WFD.cFileName, vbNullChar) - 1)rn End Ifrn rn ElseIf Not UseFileSpec% Thenrn TotalFiles% = TotalFiles% + 1rn End Ifrn Loop While FindNextFile(hItem&, WFD)rn rn Call FindClose(hItem&)rn rn End Ifrnrn If UseFileSpec% Thenrn Call SearchFileCount(curpath$)rn End Ifrn rn ' Recursively call this proc & iterate through each subdir cached above.rn For I% = 1 To dirs%rn FindDirs curpath$ & dirbuf$(I%) & vbBackslashrn If bCancelFlag = True Then Exit Functionrn Next I%rn SearchDirs = FileCountrnEnd FunctionrnrnPublic Function SearchFileCount(curpath$)rn Dim PicName As Stringrn Dim sTemp As String, sExtName As String, sSavedFile As Stringrn FileSpec$ = "*.*"rn hFile& = FindFirstFile(curpath$ & FileSpec$, WFD)rn If hFile& <> INVALID_HANDLE_VALUE Thenrn Dorn DoEventsrn sTemp = curpath$ & left$(WFD.cFileName, InStr(WFD.cFileName, vbNullChar) - 1)rn '取得文件的后缀rn sExtName = "|" + UCase(fso.GetExtensionName(sTemp)) + "|"rn '如果后缀属于系统INI里设定的图片文件后缀则加入LISTrn If InStr(1, gIni.PicFileExt, sExtName) > 0 Thenrn FileCount = FileCount + 1rn End Ifrn rn Loop While FindNextFile(hFile&, WFD)rn ' Close the search handlern Call FindClose(hFile&)rn End IfrnEnd Function 论坛

高分求救(VB不支持中文路径问题)

08-27

[color=#FF0000]rn问题:中文带“美”的中文路径就出错,不带“美”的就可以。rn为什么????[/color]rnrnrnrnrnrn[code=VB]rnrnpp="d:\美图\1.jpg"rnww="108"rnhh="90"rnShowTNImg Picture1, pp, ww, hhrnrnrnrnrnrnrnrnrn'-------------缩略图函数-----------rnPublic Function ShowTNImg(pbox As Object, ImagePath As String, WMax As Long, HMax As Long) As ImageInforn 'WMax为最大宽度,HMax为最大高度,这段代码会根据最大宽度和高度调整图片大小。rn Dim Wid As Long, Hgt As Long, Top As Long, Left As Longrnrn LoadGDIPrnrn If GdipCreateFromHDC(pbox.hDC, gdip_Graphics) <> 0 Thenrn MsgBox "出现错误!", vbCritical, "错误"rn GdiplusShutdown gdip_Tokenrn Endrn End Ifrnrn '载入图片到内存中rn GdipLoadImageFromFile StrConv(ImagePath, vbUnicode), gdip_Imagernrn '获取图片长和宽rn GdipGetImageWidth gdip_Image, Widrn GdipGetImageHeight gdip_Image, Hgtrnrn With ShowTNImgrn .Width = Widrn .Height = Hgtrn .FilePath = ImagePathrn .FileSize = FileLen(ImagePath) / 1024rn .ImageName = Right(ImagePath, Len(ImagePath) - InStrRev(ImagePath, "\"))rn .type = Right(ImagePath, Len(ImagePath) - InStrRev(ImagePath, "."))rn End Withrnrn '智能调整图片大小和留空处理,根据最长边调整rn If (Wid > WMax) Or (Hgt > HMax) Thenrn If Wid > Hgt Thenrn Hgt = Hgt / Wid * WMaxrn Wid = WMaxrn Top = (HMax - Hgt) / 2rn Elsern Wid = Wid / Hgt * HMaxrn Hgt = HMaxrn Left = (WMax - Wid) / 2rn End Ifrn Elsern Top = (HMax - Hgt) / 2rn Left = (WMax - Wid) / 2rn End Ifrnrn '使用GDI+直接从内存中缩略并绘图,GDI+有很好的抗锯齿能力rn If GdipDrawImageRect(gdip_Graphics, gdip_Image, Left, Top, Wid, Hgt) <> ok Thenrn Debug.Print "显示失败。。。"rn pbox.ForeColor = vbRedrn pbox.DrawWidth = 5rn pbox.Line (0, 0)-(pbox.Width, pbox.Height)rn pbox.Line (pbox.Width, 0)-(0, pbox.Height)rn End Ifrn DisposeGDIPrnrnEnd Functionrnrnrnrn[/code] 论坛

没有更多推荐了,返回首页