Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

only accept ascii characters

  • Loading branch information...
commit 5e2c712aa31c6a10b09476751600e3a4e015531c 1 parent f12c43a
@JPMoresmau authored
View
1  net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/util/UITexts.java
@@ -231,6 +231,7 @@
public static String newProjectWizardPage_Message_enterProjectName;
public static String newProjectWizardPage_Message_projectAlreadyExists;
public static String newProjectWizardPage_Message_projectInvalidName;
+ public static String newProjectWizardPage_Message_projectNonAsciiName;
public static String newProjectWizardPageMessage_invalidProjectNameForWorkspaceRoot;
public static String newProjectWizardPage_LocationGroup_title;
public static String newProjectWizardPage_LocationGroup_workspace_desc;
View
1  net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/util/uitexts.properties
@@ -245,6 +245,7 @@ newProjectWizardPage_NameGroup_label_text = &Project name:
newProjectWizardPage_Message_enterProjectName = Enter a project name.
newProjectWizardPage_Message_projectAlreadyExists = A project with this name already exists.
newProjectWizardPage_Message_projectInvalidName = A valid Cabal project name can only contain letters, digits and hyphens.
+newProjectWizardPage_Message_projectNonAsciiName = A valid Cabal project name should only use ASCII characters
newProjectWizardPageMessage_invalidProjectNameForWorkspaceRoot = The name of the new project must be ''{0}''
newProjectWizardPage_LocationGroup_title = Location
newProjectWizardPage_LocationGroup_workspace_desc = Create new project in &workspace
View
8 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/wizards/NewProjectWizardPage.java
@@ -13,6 +13,8 @@
import java.io.File;
import java.io.IOException;
import java.net.URI;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
import java.util.Observable;
import java.util.Observer;
import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
@@ -353,6 +355,12 @@ protected void doUpdate() {
return;
}
}
+ CharsetEncoder asciiEncoder =
+ Charset.forName("US-ASCII").newEncoder();
+ if (!asciiEncoder.canEncode( name )){
+ setIncomplete(UITexts.newProjectWizardPage_Message_projectNonAsciiName);
+ return;
+ }
// check whether project already exists
final IProject handle= workspace.getRoot().getProject(name);
Please sign in to comment.
Something went wrong with that request. Please try again.